/* ============================================================
   styles.css — shared by index.html and admin.html
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg-0: #050810; --bg-1: #0b1220; --card: #11161f; --card-2: #161b26;
  --line: rgba(255,255,255,0.08); --text: #f4f5f7; --muted: #9aa3b2;
  --gold: #f5c451; --green: #1ea84a; --red: #e6493a;
  --shadow: 0 30px 80px rgba(0,0,0,0.55);
}
html, body { margin: 0; padding: 0; background: var(--bg-0); color: var(--text); font-family: 'Manrope', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }

.stage {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 20% 20%, rgba(30,168,74,0.12), transparent 60%),
    radial-gradient(900px 600px at 85% 80%, rgba(245,196,81,0.10), transparent 60%),
    linear-gradient(180deg, #04060c 0%, #0a0f1c 60%, #050810 100%);
}
.stage::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 18%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 22%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(2px 2px at 30% 80%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(1.5px 1.5px at 65% 70%, rgba(255,255,255,0.4), transparent 60%);
  opacity: 0.7;
}

.top { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #2a3245, #11161f); display: grid; place-items: center; }
.pill { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.02); display: flex; align-items: center; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 8px; box-shadow: 0 0 12px var(--green); }
.pill .dot.off { background: var(--red); box-shadow: 0 0 12px var(--red); }

main { position: relative; z-index: 2; padding: 12px 24px 80px; max-width: 720px; margin: 0 auto; }
main.wide { max-width: 1200px; }

.card { background: linear-gradient(180deg, rgba(20,26,38,0.92), rgba(13,17,26,0.92)); border: 1px solid var(--line); border-radius: 24px; padding: 28px 26px; box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.card-head .left { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 18px; }
.card-head .close { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); cursor: pointer; display: grid; place-items: center; transition: 0.2s; }
.card-head .close:hover { background: rgba(255,255,255,0.08); transform: rotate(90deg); }
.question { display: flex; gap: 14px; align-items: flex-start; margin: 6px 0 22px; }
.flag { width: 64px; height: 44px; flex: none; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.06); background: linear-gradient(180deg, #c60b1e 0 33.3%, #ffc400 33.3% 66.6%, #c60b1e 66.6% 100%); }
.question h1 { font-size: 26px; line-height: 1.2; margin: 0; font-weight: 800; letter-spacing: -0.01em; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.choice { border: 1px solid var(--line); background: var(--card-2); color: var(--text); padding: 18px 20px; border-radius: 14px; font-weight: 700; font-size: 18px; cursor: pointer; transition: 0.18s ease; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: inherit; }
.choice .arrow { width: 22px; height: 22px; }
.choice:hover { transform: translateY(-1px); }
.choice.yes { background: linear-gradient(180deg, #22b653, #138a3a); border-color: rgba(255,255,255,0.18); box-shadow: 0 10px 24px rgba(20,140,60,0.35), inset 0 1px 0 rgba(255,255,255,0.18); }
.choice.yes:hover { filter: brightness(1.05); }
.choice.no:hover { background: #1c2230; }
.choice.selected-yes { outline: 2px solid #2cd36b; outline-offset: 2px; }

.prize { border: 1px solid rgba(245,196,81,0.45); background: radial-gradient(600px 200px at 80% 0%, rgba(245,196,81,0.10), transparent 60%), linear-gradient(180deg, rgba(245,196,81,0.04), rgba(245,196,81,0.02)); border-radius: 16px; padding: 18px; display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.trophy { font-size: 38px; }
.prize .label { color: var(--gold); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; }
.prize .amount { font-family: 'Bebas Neue', sans-serif; font-size: 36px; line-height: 1; margin-top: 4px; }
.prize .amount small { font-size: 18px; color: var(--muted); margin-left: 6px; }
.prize .note { color: var(--muted); font-size: 12.5px; margin-top: 8px; max-width: 380px; }

.tickets { display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; padding: 8px 0 6px; }
.tickets .col { text-align: center; }
.tickets .col .k { font-size: 13px; color: var(--muted); }
.tickets .col .v { font-size: 22px; font-weight: 800; margin-top: 4px; }
.tickets .div { background: var(--line); height: 32px; }
.infinity { color: var(--gold); font-size: 28px; }

.payout { margin-top: 14px; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.payout .l .t { color: var(--gold); font-weight: 700; font-size: 14px; }
.payout .l .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.payout .r { text-align: right; }
.payout .r .v { font-family: 'Bebas Neue', sans-serif; font-size: 32px; line-height: 1; }
.payout .r .v small { font-size: 14px; color: var(--muted); margin-left: 4px; }
.payout .r .s { color: var(--muted); font-size: 12px; margin-top: 4px; }

.footnote { margin-top: 18px; display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.footnote svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

.steps { margin-top: 22px; background: linear-gradient(180deg, rgba(20,26,38,0.92), rgba(13,17,26,0.92)); border: 1px solid var(--line); border-radius: 24px; padding: 26px; display: none; animation: rise 0.45s cubic-bezier(.2,.8,.2,1); }
.steps.active { display: block; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.step-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.step-tab { flex: 1; padding: 8px 10px; border-radius: 10px; text-align: center; font-size: 12px; color: var(--muted); border: 1px solid var(--line); background: rgba(255,255,255,0.02); display: flex; align-items: center; justify-content: center; gap: 8px; }
.step-tab .num { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.06); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.step-tab.done { color: #aef0bf; border-color: rgba(46,200,90,0.35); background: rgba(46,200,90,0.08); }
.step-tab.done .num { background: var(--green); color: white; }
.step-tab.current { color: var(--text); border-color: rgba(245,196,81,0.4); background: rgba(245,196,81,0.05); }
.step-tab.current .num { background: var(--gold); color: #1a1a1a; }
.step-title { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.step-sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

.phone-wrap { margin-top: 22px; }
.phone-label { font-size: 12px; color: var(--muted); margin-bottom: 10px; display: block; letter-spacing: 0.06em; }
.phone-field { display: flex; align-items: stretch; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: 0.2s; }
.phone-field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(245,196,81,0.10); }
.phone-prefix { display: flex; align-items: center; gap: 8px; padding: 0 16px; background: rgba(255,255,255,0.03); border-right: 1px solid var(--line); font-weight: 700; }
.phone-prefix .au { width: 22px; height: 14px; border-radius: 2px; background: #00247d; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); position: relative; overflow: hidden; flex: none; }
.phone-prefix .au::before {
  content: ""; position: absolute; top: 0; left: 0; width: 11px; height: 7px;
  background:
    linear-gradient(45deg, transparent 45%, white 45%, white 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, white 45%, white 55%, transparent 55%),
    linear-gradient(0deg, transparent 40%, white 40%, white 60%, transparent 60%),
    linear-gradient(90deg, transparent 40%, white 40%, white 60%, transparent 60%),
    #00247d;
}
.phone-prefix .au::after {
  content: "★"; position: absolute; left: 2px; bottom: -2px; font-size: 6px; color: white; line-height: 1;
}
.phone-input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--text); font-size: 18px; padding: 16px; font-family: 'Manrope', sans-serif; letter-spacing: 0.04em; }
.phone-input::placeholder { color: #4d5363; }
.phone-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.phone-meta .err { color: #ff7a6e; display: none; }
.phone-meta.show-err .err { display: inline; }
.phone-meta.show-err .help { display: none; }
.count { font-variant-numeric: tabular-nums; }

.actions { display: flex; gap: 10px; margin-top: 22px; }
.btn { flex: 1; padding: 14px 18px; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 15px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); transition: 0.18s; font-family: inherit; }
.btn:hover { background: #1c2230; }
.btn.primary { background: linear-gradient(180deg, #22b653, #138a3a); border-color: rgba(255,255,255,0.18); color: white; box-shadow: 0 10px 24px rgba(20,140,60,0.30), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; }
.btn.danger { background: linear-gradient(180deg, #e6493a, #b32d22); border-color: rgba(255,255,255,0.18); color: white; }
.btn.gold { background: linear-gradient(180deg, #f5c451, #d4a23a); border-color: rgba(255,255,255,0.18); color: #1a1a1a; }

.saved-card { margin-top: 22px; background: linear-gradient(180deg, rgba(20,26,38,0.92), rgba(13,17,26,0.92)); border: 1px solid rgba(46,200,90,0.30); border-radius: 24px; padding: 26px; display: none; animation: rise 0.45s cubic-bezier(.2,.8,.2,1); }
.saved-card.active { display: block; }
.saved-head { display: flex; gap: 12px; align-items: center; }
.saved-head .check { width: 44px; height: 44px; border-radius: 50%; background: rgba(46,200,90,0.15); color: #aef0bf; display: grid; place-items: center; flex: none; }
.saved-head .t { font-size: 18px; font-weight: 800; }
.saved-head .s { color: var(--muted); font-size: 13px; margin-top: 2px; }
.saved-row { margin-top: 18px; padding: 14px 16px; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; display: flex; justify-content: space-between; align-items: center; }
.saved-row .k { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.saved-row .v { font-size: 18px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.saved-row button { background: transparent; color: var(--gold); border: 1px solid rgba(245,196,81,0.4); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 700; font-family: inherit; font-size: 13px; }
.saved-row button:hover { background: rgba(245,196,81,0.08); }
.lock-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--gold); background: rgba(245,196,81,0.08); border: 1px solid rgba(245,196,81,0.3); padding: 6px 10px; border-radius: 999px; white-space: nowrap; }

.warn-box { margin-top: 22px; display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: rgba(245,196,81,0.06); border: 1px solid rgba(245,196,81,0.3); color: var(--muted); font-size: 13px; line-height: 1.5; }
.warn-box svg { flex: none; width: 20px; height: 20px; color: var(--gold); margin-top: 1px; }
.warn-box strong { color: #fff; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .two-col { grid-template-columns: 1fr; gap: 0; } }
.inline-edit { display: none; margin-top: 14px; }
.inline-edit.active { display: block; }
.inline-edit .auto-save { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.inline-edit .auto-save .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.inline-edit .auto-save.saving .dot { background: var(--gold); animation: pulse 1s ease-in-out infinite; }
.inline-edit .auto-save.saved .dot { background: var(--green); }
@keyframes pulse { 50% { opacity: 0.3; } }

.countdown { margin-top: 18px; padding: 18px; border-radius: 16px; background: radial-gradient(400px 120px at 80% 0%, rgba(245,196,81,0.12), transparent 60%), linear-gradient(180deg, rgba(245,196,81,0.06), rgba(245,196,81,0.02)); border: 1px solid rgba(245,196,81,0.35); }
.countdown .label { font-size: 12px; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }
.countdown .target { font-size: 14px; color: var(--muted); margin-top: 4px; }
.cd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.cd-cell { background: rgba(0,0,0,0.35); border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; text-align: center; }
.cd-cell .n { font-family: 'Bebas Neue', sans-serif; font-size: 28px; line-height: 1; }
.cd-cell .u { font-size: 10px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 4px; }

/* === ADMIN === */
.admin-login { max-width: 440px; margin: 60px auto 0; background: linear-gradient(180deg, rgba(20,26,38,0.95), rgba(13,17,26,0.95)); border: 1px solid var(--line); border-radius: 24px; padding: 36px 32px; box-shadow: var(--shadow); animation: rise 0.4s cubic-bezier(.2,.8,.2,1); }
.admin-login .lock { width: 56px; height: 56px; border-radius: 16px; background: rgba(245,196,81,0.12); border: 1px solid rgba(245,196,81,0.35); display: grid; place-items: center; margin-bottom: 16px; }
.admin-login h2 { font-size: 26px; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.01em; }
.admin-login p.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.06em; }
.field input { width: 100%; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--text); font-size: 15px; font-family: inherit; outline: none; transition: 0.2s; }
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(245,196,81,0.10); }
.login-err { display: none; margin-top: -4px; margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; font-size: 13px; background: rgba(230,73,58,0.10); border: 1px solid rgba(230,73,58,0.35); color: #ff8c80; }
.login-err.show { display: block; }
.firebase-warn { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: rgba(245,196,81,0.06); border: 1px dashed rgba(245,196,81,0.4); font-size: 12px; color: var(--muted); line-height: 1.5; }
.firebase-warn strong { color: var(--gold); }

.dash-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.dash-head h1 { font-size: 28px; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.dash-head h1 small { color: var(--muted); font-size: 13px; font-weight: 500; margin-left: 10px; }
.dash-actions { display: flex; gap: 8px; }
.dash-actions .btn { flex: none; padding: 10px 14px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: linear-gradient(180deg, rgba(20,26,38,0.85), rgba(13,17,26,0.85)); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stat .k { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.stat .v { font-family: 'Bebas Neue', sans-serif; font-size: 38px; line-height: 1.1; margin-top: 6px; }
.stat .v.gold { color: var(--gold); }
.stat .v.green { color: #6dd687; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.table-wrap { background: linear-gradient(180deg, rgba(20,26,38,0.85), rgba(13,17,26,0.85)); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.table-tools { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.table-tools input.search { flex: 1; min-width: 200px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; color: var(--text); font-family: inherit; font-size: 14px; outline: none; }
.table-tools input.search:focus { border-color: var(--gold); }
.table-tools select { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); font-family: inherit; font-size: 13px; }
.live-badge { font-size: 11px; color: #7ce394; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.live-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.5s ease-in-out infinite; box-shadow: 0 0 10px var(--green); }
.table-scroll { overflow-x: auto; }
table.users { width: 100%; border-collapse: collapse; min-width: 760px; }
table.users th, table.users td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13.5px; }
table.users th { background: rgba(255,255,255,0.02); color: var(--muted); font-weight: 700; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
table.users tbody tr:hover { background: rgba(255,255,255,0.02); }
table.users td.phone { font-family: monospace; font-weight: 700; color: #d6e0f0; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.badge.yes { background: rgba(46,200,90,0.15); color: #7ce394; border: 1px solid rgba(46,200,90,0.3); }
.badge.no { background: rgba(230,73,58,0.15); color: #ff9e94; border: 1px solid rgba(230,73,58,0.3); }
.badge.warn { background: rgba(245,196,81,0.12); color: var(--gold); border: 1px solid rgba(245,196,81,0.35); }
.row-actions { display: flex; gap: 6px; }
.row-actions button { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 12px; cursor: pointer; font-family: inherit; }
.row-actions button:hover { color: var(--text); }
.row-actions button.del:hover { color: #ff8c80; border-color: rgba(230,73,58,0.5); background: rgba(230,73,58,0.08); }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty .ico { font-size: 38px; margin-bottom: 10px; opacity: 0.6; }
.loading { padding: 50px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.loading .spinner { width: 28px; height: 28px; border: 3px solid rgba(245,196,81,0.2); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

.site-foot { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 20px 24px 30px; text-align: center; color: var(--muted); font-size: 12px; }
.site-foot a { color: var(--muted); text-decoration: none; border-bottom: 1px dashed transparent; cursor: pointer; }
.site-foot a:hover { color: var(--gold); border-bottom-color: var(--gold); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 80px); background: rgba(20,30,40,0.95); border: 1px solid rgba(46,200,90,0.4); color: white; padding: 12px 18px; border-radius: 12px; backdrop-filter: blur(10px); z-index: 50; transition: transform 0.4s cubic-bezier(.2,.8,.2,1); display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.toast.show { transform: translate(-50%, 0); }
.toast .ok { width: 18px; height: 18px; color: #aef0bf; }

@media (max-width: 540px) {
  .question h1 { font-size: 22px; }
  .prize .amount { font-size: 30px; }
  .payout .r .v { font-size: 26px; }
  .card, .steps, .saved-card { padding: 22px 18px; border-radius: 20px; }
  .dash-head h1 { font-size: 22px; }
  .stat .v { font-size: 30px; }
}
