:root {
    color-scheme: light;
    --cream: #f8f6f0;
    --paper: #fffefa;
    --ink: #203229;
    --muted: #81867d;
    --green: #245c43;
    --green-dark: #194733;
    --red: #c85245;
    --gold: #d9a64c;
    --line: #e9e7df;
    font-family: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--cream); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.lights { height: 27px; padding: 0 7.5%; display: flex; justify-content: space-between; align-items: flex-start; position: relative; }
.lights::before { content: ""; height: 1px; background: #d6d3c9; position: absolute; top: 0; left: 0; right: 0; }
.light { width: 9px; height: 13px; margin-top: 1px; border-radius: 45% 45% 50% 50%; display: block; position: relative; animation: glow 2.4s ease-in-out infinite alternate; }
.light::before { content: ""; width: 3px; height: 4px; background: #b7b2a8; position: absolute; top: -4px; left: 3px; }
.light.red { background: #d97165; box-shadow: 0 2px 9px #d9716580; }
.light.green { background: #60a578; box-shadow: 0 2px 9px #60a57880; animation-delay: .6s; }
.light.gold { background: #e6bf67; box-shadow: 0 2px 9px #e6bf6780; animation-delay: 1.2s; }
.light.blue { background: #76aeb3; box-shadow: 0 2px 9px #76aeb380; animation-delay: 1.8s; }
@keyframes glow { from { opacity: .66; filter: brightness(.9); } to { opacity: 1; filter: brightness(1.13); } }
.topbar { height: 74px; padding: 0 8%; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eeece5; }
.brand { display: flex; gap: 9px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -.5px; }
.brand-icon { font-size: 19px; }
.brand-dot { color: var(--red); }
.admin-entry, .text-button { padding: 8px 0; border: 0; background: none; color: #64736a; font-size: 12px; font-weight: 700; }
.admin-entry span { margin-left: 7px; color: var(--green); }
main { width: min(1050px, 84%); margin: 0 auto; }
.participant-view { padding-top: 81px; }
.hero { display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 4%; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; color: #687a69; font-size: 10px; font-weight: 800; letter-spacing: 1.8px; }
.eyebrow-star { color: var(--gold); font-size: 16px; }
h1, h2, h3, p { margin-top: 0; }
h1, .auth-panel h1 { margin: 19px 0 17px; font-family: "Playfair Display", Georgia, serif; font-size: clamp(40px, 5.2vw, 61px); line-height: 1.12; letter-spacing: -1.7px; font-weight: 700; }
h1 span, .auth-panel h1 span { color: var(--red); font-style: italic; }
.hero-description { max-width: 425px; margin: 0; color: #74786f; font-size: 14px; line-height: 1.9; }
.hero-note { display: flex; align-items: center; gap: 10px; margin-top: 28px; color: #777a72; font-size: 11px; }
.lock-icon { font-size: 15px; }
.present-stage { min-height: 282px; display: flex; justify-content: center; align-items: center; position: relative; }
.present { width: 180px; height: 176px; position: relative; margin-top: 30px; filter: drop-shadow(0 20px 20px #856d4430); animation: float 3.8s ease-in-out infinite; }
.present-box { width: 164px; height: 126px; position: absolute; left: 8px; bottom: 0; border-radius: 7px 7px 12px 12px; background: linear-gradient(140deg, #ce6255, #ac4038); box-shadow: inset -12px -8px 0 #9e3b35; }
.present-lid { width: 180px; height: 37px; position: absolute; z-index: 2; top: 32px; left: 0; border-radius: 7px; background: linear-gradient(140deg, #dd7568, #c65348); box-shadow: inset -9px -4px 0 #b34840; }
.ribbon { width: 27px; height: 100%; position: absolute; left: 69px; background: #e8ba63; box-shadow: inset -4px 0 0 #d9a64c; }
.present-lid::after { content: ""; width: 27px; height: 38px; position: absolute; left: 77px; top: -1px; background: #e8ba63; }
.bow { width: 40px; height: 24px; position: absolute; z-index: 2; left: 70px; top: -17px; border: 7px solid #e8ba63; border-radius: 50% 50% 8px 50%; transform: rotate(38deg); }
.present-star { position: absolute; right: 18px; bottom: 14px; color: #ffffff9e; font-size: 21px; }
.present-shadow { width: 155px; height: 15px; position: absolute; bottom: 30px; left: calc(50% - 77px); border-radius: 50%; background: #9c8b6940; filter: blur(7px); }
.sparkle { position: absolute; color: var(--gold); }
.sparkle-one { left: 16%; top: 25%; font-size: 24px; }
.sparkle-two { right: 16%; top: 22%; color: #96b998; font-size: 28px; }
.sparkle-three { right: 20%; bottom: 20%; color: #d98b7d; font-size: 21px; }
.stage-label { position: absolute; bottom: 7px; color: #85877c; font-size: 10px; letter-spacing: .3px; }
.stage-label span, .footer-heart { color: var(--red); }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-9px) rotate(1deg); } }
.reveal-card { max-width: 630px; min-height: 220px; margin: 32px auto 0; padding: 22px 34px 28px; border: 1px solid #eeece3; border-radius: 13px; background: var(--paper); box-shadow: 0 13px 36px #45452a0a; text-align: center; }
.card-topline { display: flex; align-items: center; justify-content: center; gap: 8px; padding-bottom: 15px; border-bottom: 1px solid #f0eee7; color: #7a8074; font-size: 9px; font-weight: 800; letter-spacing: 1.3px; }
.card-topline span:first-child { font-size: 13px; }
.loading-state { padding: 40px 0; color: var(--muted); font-size: 13px; }
.participant-prompt, .public-empty { padding-top: 19px; }
.person-avatar { width: 33px; height: 33px; margin: 0 auto 9px; display: grid; place-items: center; border-radius: 50%; background: #f3f0e5; color: var(--gold); }
.participant-prompt h2, .public-empty h2 { margin: 0 0 7px; font-family: "Playfair Display", Georgia, serif; font-size: 23px; }
.participant-prompt > p, .public-empty > p { max-width: 405px; margin: 0 auto; color: #777a72; font-size: 12px; line-height: 1.7; }
.primary-button { min-height: 46px; padding: 0 20px; border: 0; border-radius: 7px; background: var(--green); color: white; font-size: 10px; font-weight: 800; letter-spacing: .7px; display: inline-flex; justify-content: center; align-items: center; gap: 19px; transition: background .2s, transform .2s; }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .7; cursor: wait; }
.reveal-button { width: min(100%, 335px); margin: 19px 0 11px; }
.reveal-button.is-loading span:first-child::after { content: "…"; }
.privacy-note { font-size: 10px !important; }
.privacy-note span { margin-right: 4px; }
.result-view { padding: 20px 0 0; position: relative; }
.result-sparkle { color: var(--gold); font-size: 26px; }
.result-kicker { margin: 7px 0 4px; color: #75796f; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.result-view h2 { margin: 0 0 7px; color: var(--red); font-family: "Playfair Display", Georgia, serif; font-size: clamp(34px, 7vw, 48px); text-transform: uppercase; }
.result-message { max-width: 410px; margin: 0 auto 9px; color: #777a72; font-size: 12px; line-height: 1.7; }
.text-button { color: var(--green); text-decoration: underline; font-size: 11px; }
.result-animate { animation: reveal .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.error-message { margin: 14px 0 0; color: #a63d35; font-size: 12px; line-height: 1.6; }
.success-message { margin: 14px 0 0; color: var(--green); font-size: 12px; line-height: 1.6; }
.page-footer { max-width: 630px; margin: 35px auto 25px; padding-top: 14px; border-top: 1px solid #e9e7df; display: flex; justify-content: space-between; gap: 15px; color: #83867d; font-size: 9px; }
.page-footer span:first-child { letter-spacing: 1px; }
.admin-view { min-height: 75vh; padding: 45px 0 60px; }
.auth-panel { width: min(440px, 100%); margin: 0 auto; padding: 24px 30px 32px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.back-link { display: inline-block; margin-bottom: 30px; color: #6f786e; font-size: 12px; text-decoration: none; }
.auth-panel h1 { margin: 12px 0; font-size: 44px; }
.auth-panel > p { color: #777a72; font-size: 13px; line-height: 1.6; }
.auth-panel form { margin-top: 23px; }
.field-label { display: block; margin: 0 0 8px; color: #525f55; font-size: 11px; font-weight: 700; }
.field-label span { color: #909188; font-weight: 400; }
.field-label input, .field-label textarea, input, textarea, select { width: 100%; }
.auth-panel input, .inline-form input, .participant-add textarea, .event-card select { min-height: 43px; padding: 11px 12px; border: 1px solid #e5e3db; border-radius: 6px; outline: 0; background: #fff; color: var(--ink); font-size: 13px; }
.auth-panel input:focus, .inline-form input:focus, .participant-add textarea:focus, .event-card select:focus { border-color: #93aa97; box-shadow: 0 0 0 3px #245c4310; }
.auth-panel .field-label { margin-bottom: 15px; }
.auth-panel .primary-button { width: 100%; margin-top: 4px; }
.dashboard { width: 100%; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 27px; }
.dashboard-heading h1 { margin-bottom: 0; font-size: clamp(38px, 5vw, 52px); }
.outline-button { min-height: 39px; padding: 0 14px; border: 1px solid #dfe2d9; border-radius: 6px; background: #fffefa; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .4px; }
.outline-button:hover { background: #f4f6ef; }
.dashboard-grid { display: grid; grid-template-columns: .8fr 1.2fr; align-items: start; gap: 17px; }
.admin-card { padding: 23px; border: 1px solid #eae8df; border-radius: 11px; background: var(--paper); }
.admin-card h2 { margin: 7px 0 6px; font-family: "Playfair Display", Georgia, serif; font-size: 21px; }
.admin-card > p { margin-bottom: 20px; color: #7d7f76; font-size: 12px; line-height: 1.6; }
.card-icon { color: var(--gold); font-size: 20px; }
.inline-form .field-label { margin-top: 20px; }
.input-action { display: flex; gap: 8px; }
.input-action input { min-width: 0; }
.compact-button { min-height: 42px; white-space: nowrap; padding: 0 14px; gap: 10px; }
.card-heading, .event-name-line, .list-heading, .draw-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-heading { align-items: flex-start; }
.card-heading h2 { margin-top: 4px; }
.count-pill { padding: 5px 9px; border-radius: 20px; background: #eef3eb; color: #51745a; font-size: 10px; white-space: nowrap; }
.event-card select { min-height: 41px; margin-bottom: 17px; }
.event-name-line { padding-bottom: 14px; border-bottom: 1px solid #efede5; }
.event-name-line h3 { margin: 0; font-size: 13px; }
.participant-add { padding: 15px 0; border-bottom: 1px solid #efede5; }
.participant-add textarea { min-height: 76px; resize: vertical; font-size: 12px; }
.participant-add .outline-button { min-height: 34px; margin-top: 8px; }
.draw-action { margin-top: 15px; padding: 12px; border-radius: 7px; background: #f4f5ee; }
.draw-action > div { display: grid; gap: 4px; }
.draw-action strong { font-size: 11px; }
.draw-action span { color: #7a7d74; font-size: 10px; line-height: 1.5; }
.participants-list { margin-top: 20px; }
.list-heading { margin-bottom: 10px; }
.list-heading h3 { margin: 0; font-family: "Playfair Display", Georgia, serif; font-size: 16px; }
.list-heading span { color: #82847b; font-size: 10px; }
.participant-row { min-height: 55px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #f0eee7; }
.row-avatar { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border-radius: 50%; background: #f2efe5; color: #728668; font-size: 12px; font-weight: 700; }
.row-person { flex: 1; min-width: 0; display: grid; gap: 3px; }
.row-person strong { overflow: hidden; color: #39443b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.row-person span { overflow: hidden; color: #888980; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.icon-button, .whatsapp-link { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border: 1px solid #eae8e0; border-radius: 5px; background: #fffefa; color: #607162; font-size: 12px; text-decoration: none; }
.icon-button:hover { color: var(--red); border-color: #e5c1ba; }
.whatsapp-link { border-color: #dce8df; color: #388a57; font-size: 9px; font-weight: 800; }
.empty-note { padding: 24px 12px; border-radius: 7px; background: #f7f6f0; color: #7e8178; font-size: 12px; line-height: 1.7; text-align: center; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: calc(100vw - 40px); padding: 12px 17px; border-radius: 7px; background: #233d2d; color: #fff; font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(9px); transition: .2s ease; z-index: 10; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
    .lights { padding: 0 4%; }
    .light { width: 7px; height: 11px; }
    .topbar { height: 62px; padding: 0 6%; }
    .brand { font-size: 16px; }
    .admin-entry { font-size: 11px; }
    main { width: 88%; }
    .participant-view { padding-top: 45px; }
    .hero { grid-template-columns: 1fr; gap: 6px; }
    h1 { font-size: clamp(42px, 10.5vw, 58px); }
    .hero-description { max-width: 460px; font-size: 13px; }
    .hero-note { margin-top: 18px; }
    .present-stage { min-height: 225px; }
    .present { transform: scale(.85); margin-top: 12px; }
    .present-stage .sparkle-one { left: 20%; top: 14%; }
    .present-stage .sparkle-two { right: 19%; top: 12%; }
    .present-shadow { bottom: 22px; }
    .stage-label { bottom: 0; }
    .reveal-card { margin-top: 23px; padding: 19px 20px 23px; }
    .page-footer { font-size: 8px; }
    .admin-view { padding-top: 30px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-heading { align-items: flex-start; }
    .dashboard-heading h1 { font-size: 42px; }
}
@media (max-width: 390px) {
    main { width: 91%; }
    .admin-entry { font-size: 10px; }
    .reveal-card { padding-right: 14px; padding-left: 14px; }
    .auth-panel { padding-right: 20px; padding-left: 20px; }
    .admin-card { padding: 18px; }
    .draw-action { align-items: flex-start; }
    .draw-action .compact-button { padding: 0 9px; font-size: 9px; }
    .participant-row { gap: 5px; }
    .page-footer { flex-direction: column; align-items: center; }
}
