/* Tigule raffle draw UI */
.rf-page { --rf-red: #c8102e; --rf-purple: #c8102e; --rf-ink: #0f172a; --rf-muted: #64748b; --rf-line: #e2e8f0; --rf-gold: #f59e0b; }
.rf-back { display: inline-flex; gap: 8px; align-items: center; color: var(--rf-muted); text-decoration: none; font-weight: 600; margin-bottom: 14px; }
.rf-back:hover { color: var(--rf-red); }

.rf-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px; margin-bottom: 20px; color: #fff;
  background: radial-gradient(circle at 85% 15%, rgba(245,158,11,.35), transparent 40%),
              linear-gradient(135deg, #4a0613 0%, #c8102e 45%, #c8102e 100%);
  box-shadow: 0 18px 40px rgba(200,16,46, .25);
}
.rf-hero::after { content: "\f3ff"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: -10px; bottom: -30px; font-size: 160px; opacity: .08; transform: rotate(-18deg); }
.rf-hero h1 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin: 8px 0 6px; letter-spacing: -.02em; color: #fff !important; overflow-wrap: anywhere; }
.rf-hero p { margin: 0; opacity: .9; max-width: 640px; }
.rf-eyebrow { display: inline-flex; gap: 6px; align-items: center; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.rf-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }

.rf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; font-size: .92rem; }
.rf-btn:hover { transform: translateY(-1px); }
.rf-btn:disabled, .rf-btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.rf-btn-primary { background: linear-gradient(135deg, var(--rf-red), #9a0c24); color: #fff; box-shadow: 0 10px 22px rgba(200,16,46,.28); }
.rf-btn-primary:hover { color: #fff; }
.rf-btn-gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1f2937; box-shadow: 0 10px 22px rgba(245,158,11,.3); }
.rf-btn-ghost { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.rf-btn-ghost:hover { color: #fff; background: rgba(255,255,255,.25); }
.rf-btn-light { background: #fff; color: var(--rf-ink); border: 1px solid var(--rf-line); }
.rf-btn-light:hover { color: var(--rf-red); }
.rf-btn-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.rf-btn-sm { padding: 6px 11px; font-size: .8rem; border-radius: 10px; }

.rf-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 992px) { .rf-grid { grid-template-columns: 1fr; } }

.rf-card { background: #fff; border: 1px solid var(--rf-line); border-radius: 18px; padding: 20px; margin-bottom: 18px; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.rf-card h3 { font-size: 1.05rem; font-weight: 800; color: var(--rf-ink); margin: 0 0 4px; display: flex; gap: 8px; align-items: center; }
.rf-card h3 i { color: var(--rf-red); }
.rf-card .rf-sub { color: var(--rf-muted); font-size: .88rem; margin: 0 0 14px; }

.rf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.rf-stat { background: #fff; border: 1px solid var(--rf-line); border-radius: 16px; padding: 14px 16px; }
.rf-stat .k { font-size: 11px; font-weight: 800; color: var(--rf-muted); text-transform: uppercase; letter-spacing: .04em; }
.rf-stat .v { font-size: 1.35rem; font-weight: 800; color: var(--rf-ink); margin-top: 4px; }

.rf-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.rf-pill.draft { background: #f1f5f9; color: #475569; }
.rf-pill.open { background: #dcfce7; color: #166534; }
.rf-pill.closed { background: #fef3c7; color: #92400e; }
.rf-pill.drawn, .rf-pill.completed { background: #ffe4e6; color: #9f1239; }
.rf-pill.cancelled, .rf-pill.void, .rf-pill.forfeited, .rf-pill.refund_due { background: #fee2e2; color: #991b1b; }
.rf-pill.active, .rf-pill.pending_claim, .rf-pill.pending_payment { background: #fef3c7; color: #92400e; }
.rf-pill.won, .rf-pill.claimed { background: #fef3c7; color: #92400e; }
.rf-pill.lost, .rf-pill.refunded { background: #f1f5f9; color: #64748b; }

.rf-prizes { display: grid; gap: 10px; }
.rf-prize { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--rf-line); border-radius: 14px; background: linear-gradient(90deg, #fffbeb, #fff 40%); }
.rf-prize-rank { flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; color: #fff; background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.rf-prize-rank.r2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); }
.rf-prize-rank.r3 { background: linear-gradient(135deg, #fdba74, #c2410c); }
.rf-prize-rank.rn { background: linear-gradient(135deg, #fb7185, #9f1239); }
.rf-prize img { width: 54px; height: 54px; object-fit: cover; border-radius: 12px; }
.rf-prize h4 { margin: 0; font-size: .98rem; font-weight: 800; }
.rf-prize small { color: var(--rf-muted); }

.rf-packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rf-package { position: relative; border: 2px solid var(--rf-line); border-radius: 16px; padding: 14px; cursor: pointer; text-align: center; transition: border-color .12s, box-shadow .12s, transform .12s; background: #fff; }
.rf-package:hover { border-color: #fda4af; transform: translateY(-2px); }
.rf-package input { position: absolute; opacity: 0; }
.rf-package.is-selected { border-color: var(--rf-purple); box-shadow: 0 10px 24px rgba(200,16,46,.18); }
.rf-package .n { font-size: 1.6rem; font-weight: 900; color: var(--rf-purple); line-height: 1; }
.rf-package .l { font-size: .78rem; color: var(--rf-muted); font-weight: 700; text-transform: uppercase; }
.rf-package .p { margin-top: 8px; font-weight: 800; color: var(--rf-ink); }
.rf-package .each { font-size: .75rem; color: var(--rf-muted); }
.rf-package .best { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--rf-gold); color: #1f2937; font-size: 10px; font-weight: 900; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

.rf-progress { height: 12px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.rf-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--rf-purple), var(--rf-red)); border-radius: 999px; transition: width .6s ease; }

.rf-countdown { display: flex; gap: 8px; }
.rf-countdown div { flex: 1; text-align: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 8px 4px; }
.rf-countdown b { display: block; font-size: 1.4rem; line-height: 1; }
.rf-countdown small { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.rf-card .rf-countdown div { background: #f8fafc; border-color: var(--rf-line); color: var(--rf-ink); }

.rf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rf-chip { font-family: ui-monospace, Menlo, monospace; font-weight: 800; font-size: .8rem; padding: 5px 10px; border-radius: 999px; background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.rf-chip.won { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.rf-chip.void { background: #f1f5f9; color: #94a3b8; text-decoration: line-through; border-color: #e2e8f0; }
.rf-chip.lost { background: #f8fafc; color: #64748b; border-color: #e2e8f0; }

.rf-ticket-card { display: flex; border-radius: 16px; overflow: hidden; border: 1px solid #fecdd3; background: #fff; margin-bottom: 10px; }
.rf-ticket-card .stub { flex: 0 0 90px; background: linear-gradient(160deg, var(--rf-purple), var(--rf-red)); color: #fff; display: grid; place-items: center; font-size: 1.8rem; position: relative; }
.rf-ticket-card .stub::after { content: ""; position: absolute; right: -7px; top: 0; bottom: 0; width: 14px; background: radial-gradient(circle, #fff 5px, transparent 6px) 0 0 / 14px 16px repeat-y; }
.rf-ticket-card .body { padding: 14px 16px; flex: 1; min-width: 0; }

.rf-table { width: 100%; border-collapse: collapse; }
.rf-table th, .rf-table td { padding: 10px 8px; border-bottom: 1px solid var(--rf-line); font-size: .88rem; text-align: left; vertical-align: middle; }
.rf-table th { font-size: 11px; color: var(--rf-muted); text-transform: uppercase; letter-spacing: .04em; }
.rf-mono { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; word-break: break-all; }

.rf-fair { border: 1px dashed #fda4af; background: #fff5f6; border-radius: 14px; padding: 14px; font-size: .85rem; color: #7f0a1f; }
.rf-fair code { color: #c8102e; word-break: break-all; }

.rf-winner { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid #fde68a; background: linear-gradient(90deg, #fffbeb, #fff); margin-bottom: 8px; }
.rf-winner .trophy { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #f59e0b; color: #fff; }

.rf-formset-row { border: 1px solid var(--rf-line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: #fcfcfd; }
.rf-empty { text-align: center; color: var(--rf-muted); padding: 22px; border: 1px dashed var(--rf-line); border-radius: 14px; }

/* Event page compact raffle card */
.rf-mini { position: relative; display: flex; gap: 14px; align-items: center; padding: 14px; margin-bottom: 18px; border-radius: 18px; border: 1px solid #fecdd3; overflow: hidden;
  background: radial-gradient(circle at 100% 0, rgba(245,158,11,.12), transparent 40%), linear-gradient(180deg, #fff, #fff7f8); box-shadow: 0 10px 24px rgba(74,6,19,.06); }
.rf-mini__thumb { flex: 0 0 76px; height: 76px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; font-size: 1.7rem; color: #3b0a10; background: linear-gradient(135deg, #fcd34d, #f59e0b); }
.rf-mini__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rf-mini__body { flex: 1; min-width: 0; }
.rf-mini__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.rf-mini__tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, #c8102e, #7f0a1f); }
.rf-mini .rf-pill { padding: 2px 8px; font-size: 10px; }
.rf-mini__title { margin: 0; font-size: 1.02rem; font-weight: 900; color: var(--rf-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-mini__prize { margin: 2px 0 0; font-size: .84rem; font-weight: 700; color: #92400e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-mini__prize i { color: #f59e0b; }
.rf-mini__info { margin: 4px 0 0; font-size: .8rem; color: var(--rf-muted); }
.rf-mini__info i { color: var(--rf-red); width: 14px; }
.rf-mini__info strong { color: var(--rf-ink); font-variant-numeric: tabular-nums; }
.rf-mini__info strong b { font-weight: 900; }
.rf-mini__actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 576px) {
  .rf-mini { flex-wrap: wrap; padding: 12px; }
  .rf-mini__thumb { flex-basis: 60px; height: 60px; }
  .rf-mini__actions { flex: 1 0 100%; flex-direction: row; flex-wrap: wrap; }
  .rf-mini__actions .rf-btn { flex: 1; }
}

/* Confirm modal (raffles.js: form[data-rf-confirm]) */
html.rf-modal-lock { overflow: hidden; }
.rf-modal { position: fixed; inset: 0; z-index: 20000; display: grid; place-items: center; padding: 16px; visibility: hidden; pointer-events: none; }
.rf-modal.is-open { visibility: visible; pointer-events: auto; }
.rf-modal__backdrop { position: absolute; inset: 0; background: rgba(30, 4, 10, .55); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s ease; }
.rf-modal.is-open .rf-modal__backdrop { opacity: 1; }
.rf-modal__card {
  --tone: #c8102e; --tone-soft: #fff1f2; --tone-ink: #fff;
  position: relative; width: 100%; max-width: 420px; background: #fff; border-radius: 22px;
  padding: 28px 24px 20px; text-align: center; box-shadow: 0 30px 70px rgba(30, 4, 10, .35);
  transform: translateY(16px) scale(.96); opacity: 0; transition: transform .22s cubic-bezier(.2, .9, .3, 1.2), opacity .18s ease;
}
.rf-modal.is-open .rf-modal__card { transform: none; opacity: 1; }
.rf-modal__card.tone-gold { --tone: #f59e0b; --tone-soft: #fffbeb; --tone-ink: #4a0613; }
.rf-modal__card.tone-danger { --tone: #9f1239; --tone-soft: #fff1f2; }
.rf-modal__card::before { content: ""; position: absolute; inset: 0 0 auto; height: 86px; border-radius: 22px 22px 0 0; background: linear-gradient(180deg, var(--tone-soft), transparent); pointer-events: none; }
.rf-modal__x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f4f4f5; color: #52525b; display: grid; place-items: center; cursor: pointer; }
.rf-modal__x:hover { background: #e4e4e7; }
.rf-modal__icon { position: relative; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; font-size: 1.6rem; color: var(--tone-ink); background: var(--tone); box-shadow: 0 12px 26px color-mix(in srgb, var(--tone) 40%, transparent); transform: rotate(-6deg); }
.rf-modal__title { position: relative; margin: 0 0 6px; font-size: 1.25rem; font-weight: 800; color: #18181b; letter-spacing: -.01em; }
.rf-modal__text { margin: 0 0 12px; color: #52525b; font-size: .92rem; line-height: 1.5; }
.rf-modal__points { list-style: none; counter-reset: rfp; margin: 0 0 18px; padding: 12px 14px; text-align: left; background: #fafafa; border: 1px solid #f1f1f3; border-radius: 14px; display: grid; gap: 8px; }
.rf-modal__points li { counter-increment: rfp; position: relative; padding-left: 30px; font-size: .86rem; color: #3f3f46; line-height: 1.45; }
.rf-modal__points li::before { content: counter(rfp); position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: var(--tone-ink); background: var(--tone); }
.rf-modal__actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.rf-modal__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 13px; border: 0; font-weight: 800; font-size: .92rem; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.rf-modal__btn:active { transform: scale(.98); }
.rf-modal__btn--ghost { background: #f4f4f5; color: #3f3f46; }
.rf-modal__btn--ghost:hover { background: #e4e4e7; }
.rf-modal__btn--ok { background: var(--tone); color: var(--tone-ink); box-shadow: 0 10px 22px color-mix(in srgb, var(--tone) 35%, transparent); }
.rf-modal__btn--ok:hover { filter: brightness(1.06); }
.rf-modal__btn--ok:disabled { opacity: .8; cursor: wait; }
.rf-modal__spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rfSpin .7s linear infinite; }
@keyframes rfSpin { to { transform: rotate(360deg); } }
@media (max-width: 575px) {
  .rf-modal { place-items: end center; padding: 0; }
  .rf-modal__card { max-width: none; border-radius: 22px 22px 0 0; padding: 26px 18px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); }
  .rf-modal__card::before { border-radius: 22px 22px 0 0; }
  .rf-modal__actions { grid-template-columns: 1fr; }
  .rf-modal__btn--ok { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  .rf-modal__card, .rf-modal__backdrop { transition: none; }
}
