/* Raffle styles. Colours come from the site's theme variables in style.css, so each lodge's raffle
   matches its website. Optional overrides: --ticket-cream, --ticket-holder-bg. */
:root { --ticket-ink: var(--lodge-green); }

.raffle-head { background: linear-gradient(160deg, var(--lodge-green-dark), var(--lodge-green)); border-bottom: 4px solid var(--lodge-gold); padding: 2rem 1rem 2.2rem; }
.raffle-sample-banner { background: var(--lodge-gold); color: var(--lodge-green-dark); text-align: center; font-weight: 700; letter-spacing: .1em; font-size: .75rem; padding: .3rem; text-transform: uppercase; display: none; }

.rticket { --notch: var(--lodge-green-dark); position: relative; display: flex; max-width: 880px; margin: 0 auto; border-radius: 14px; background: var(--ticket-cream, #fbf7e8); color: var(--ticket-ink); box-shadow: 0 10px 30px rgba(0,0,0,.35); outline: 2px solid var(--lodge-gold); outline-offset: -9px; }
.rticket-main { flex: 1; padding: 1.6rem 1.8rem 1.4rem 2rem; min-width: 0; }
.rticket-lodge { display: flex; gap: .9rem; align-items: center; padding-bottom: .8rem; border-bottom: 1px solid rgba(0,0,0,.18); }
.rticket-emblem { width: 72px; height: 72px; background: var(--lodge-green); border-radius: 50%; padding: 6px; flex: none; object-fit: contain; display: block; }
.rticket-lodge-name { font-family: Georgia, serif; font-weight: 700; font-size: 1.3rem; letter-spacing: .02em; }
.rticket-sub { font-size: .85rem; color: #5d5360; }
.rticket-title { font-family: Georgia, serif; font-size: clamp(1.6rem, 4.2vw, 2.5rem); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: .8rem 0 .4rem; line-height: 1.15; }
.rticket-meta { display: flex; gap: 2rem; flex-wrap: wrap; }
.rticket-meta span, .rticket-holder span, .rticket-stub > span { display: block; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #8a6a00; }
.rticket-meta b { font-size: 1.05rem; }
.rticket-holder { margin-top: .9rem; padding: .6rem .9rem; border-radius: 8px; background: var(--ticket-holder-bg, transparent); border-top: 1px dashed rgba(0,0,0,.25); }
.rticket-holder b { font-family: Georgia, serif; font-size: 1.35rem; }
.rticket-stub { position: relative; flex: 0 0 210px; border-left: 3px dashed var(--lodge-gold); background: var(--lodge-green); color: #fff; border-radius: 0 14px 14px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1rem; gap: .35rem; }
.rticket-stub > span { color: var(--lodge-gold-bright); }
.rticket-number { font-family: "Courier New", monospace; font-size: 1.7rem; letter-spacing: .08em; color: #fff; }
.rticket-number.ph { opacity: .35; }
.rticket-admit { font-family: Georgia, serif; letter-spacing: .25em; font-size: .9rem; color: var(--lodge-gold-bright); border: 1px solid var(--lodge-gold); padding: .5rem .8rem; margin-top: .4rem; }
.rticket-qr { width: 120px; height: 120px; background: #fff; padding: 4px; border-radius: 6px; margin-top: .3rem; }
.rticket-stub::before, .rticket-stub::after { content: ""; position: absolute; left: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--notch); }
.rticket-stub::before { top: -12px; } .rticket-stub::after { bottom: -12px; }

.raffle-prize { margin: 0 0 1.5rem; border: 3px solid var(--lodge-gold); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.raffle-prize img { display: block; width: 100%; height: auto; } /* always full width; the admin picks fit or crop when uploading */
.raffle-facts { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; gap: .5rem 2rem; flex-wrap: wrap; }
.raffle-notice { background: #fff8dc; border: 1px solid var(--lodge-gold); border-radius: 8px; padding: .7rem 1rem; margin-bottom: 1rem; }
.raffle-pay { text-align: left; background: var(--ticket-cream, #fbf7e8); border: 1px solid var(--lodge-gold); border-radius: 8px; padding: 1rem; margin: 1rem 0; }
.raffle-ref { font-family: "Courier New", monospace; font-size: 1.6rem; letter-spacing: .1em; color: var(--lodge-green); background: var(--ticket-cream, #fbf7e8); display: inline-block; padding: .2rem 1rem; border: 1px dashed var(--lodge-gold); border-radius: 6px; }
.raffle-hp { position: absolute; left: -9999px; height: 0; opacity: 0; }

.raffle-admin-table table { width: 100%; border-collapse: collapse; }
.raffle-admin-table th, .raffle-admin-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid #e3d9e6; vertical-align: top; }
.raffle-admin-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #8a6a00; }
.raffle-admin-table tr.sel { background: rgba(0,0,0,.035); }
.raffle-admin-table .actions form { display: inline-block; margin-right: .5rem; }
.raffle-admin-table button.link { background: none; border: 0; color: var(--lodge-green); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; padding: 0; }
.rpill { padding: .1rem .6rem; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #eee; }
.rpill.pending { background: #fff1c2; } .rpill.paid { background: #cfeedb; color: #14532d; } .rpill.cancelled { background: #eee; color: #777; }

@media (max-width: 640px) {
  .rticket { flex-direction: column; outline-offset: -7px; }
  .rticket-main { padding: 1.4rem 1.3rem 1rem; }
  .rticket-stub { flex-basis: auto; border-left: 0; border-top: 3px dashed var(--lodge-gold); border-radius: 0 0 14px 14px; }
  .rticket-stub::before, .rticket-stub::after { top: -12px; bottom: auto; }
  .rticket-stub::before { left: -12px; } .rticket-stub::after { left: auto; right: -12px; }
}

.raffle-ticket-view { max-width: 920px; }
.raffle-ticket-view .rticket { --notch: var(--paper, #f7f2f8); box-shadow: 0 4px 14px rgba(0,0,0,.2); }

/* sample PDF (?print=1) */
@page { size: A4; margin: 0; }
@media print {
  .noprint, .floating-donate-btn { display: none !important; }
  body:has(.raffle-ticket-view) .topbar { display: none; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #fff; }
  .raffle-head, .rticket-stub, .raffle-prize, .btn { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card, .raffle-prize, .rticket { break-inside: avoid; }
  .raffle-prize img { max-height: 300px; width: auto; max-width: 100%; margin: 0 auto; }
  .raffle-ticket-view .rticket { --notch: #fff; box-shadow: none; }
}

/* ---- raffle v2: steps, bank box, claim page ---- */
.mono { font-family: "Courier New", monospace; letter-spacing: .04em; }
.raffle-steps { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .8rem; }
.raffle-steps li { display: flex; gap: .9rem; align-items: flex-start; background: #fff; border: 1px solid #e3d9e6; border-radius: 10px; padding: .8rem 1rem; }
.raffle-steps li > span { flex: none; width: 2rem; height: 2rem; line-height: 2rem; text-align: center; border-radius: 50%; background: var(--lodge-green); color: var(--lodge-gold-bright); font-weight: 700; }
.raffle-claim-cta { text-align: center; margin: 0 0 1.5rem; }
.hold-box { background: #fff8dc; border: 1px solid var(--lodge-gold); border-radius: 10px; padding: .9rem 1.1rem; margin: 1rem 0; }
.warn-ref { background: #fdeaea; border: 1px solid #e5a3a3; border-radius: 8px; padding: .6rem .9rem; margin: 1rem 0 0; }
.bank-box { border: 2px solid var(--lodge-gold); background: var(--ticket-cream, #fcf6ec); border-radius: 12px; padding: .9rem 1.1rem; }
.bank-title { font-family: Georgia, serif; font-weight: 700; font-size: 1.15rem; color: var(--lodge-green); margin-bottom: .4rem; }
.bank-box dl { margin: 0; }
.bank-box dl > div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid rgba(0,0,0,.08); flex-wrap: wrap; }
.bank-box dt { color: #6b5f6b; font-size: .9rem; }
.bank-box dd { margin: 0; font-weight: 700; font-size: 1.05rem; text-align: right; }
.bank-box .bank-ref { background: rgba(240,180,0,.18); border-radius: 8px; padding: .55rem .6rem; margin-top: .4rem; border-bottom: 0; }
.bank-box .bank-ref dd { color: var(--lodge-green); font-size: 1.3rem; }
.copy { font: inherit; font-size: .72rem; margin-left: .4rem; padding: .1rem .6rem; border: 1px solid var(--lodge-gold); background: #fff; color: var(--lodge-green); border-radius: 999px; cursor: pointer; font-weight: 600; }
.claim-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem 1.2rem; }
.claim-summary span { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #8a6a00; }
.claim-summary b { color: var(--lodge-green); }
.result { border-radius: 10px; padding: 1rem 1.2rem; margin: 1rem 0; border: 1px solid; }
.result h3 { margin: 0 0 .4rem; font-family: Georgia, serif; }
.result.ok { background: #eaf6ec; border-color: #8fcf9a; color: #14532d; }
.result.wait { background: #fff8dc; border-color: var(--lodge-gold); }
.claim-h { font-family: Georgia, serif; color: var(--lodge-green); }
.claim-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; }
.claim-opt { background: #fff; border: 2px solid #e3d9e6; border-radius: 12px; padding: 1.1rem 1.2rem; position: relative; }
.claim-opt h4 { margin: .1rem 0 .4rem; color: var(--lodge-green); font-family: Georgia, serif; font-size: 1.1rem; }
.claim-opt p { font-size: .92rem; margin: 0 0 .8rem; }
.claim-num { position: absolute; top: -.8rem; left: 1rem; width: 1.8rem; height: 1.8rem; line-height: 1.8rem; text-align: center; border-radius: 50%; background: var(--lodge-gold); color: var(--lodge-green-dark); font-weight: 700; }
.claim-opt input[type=file] { padding: .5rem; border: 1px dashed var(--lodge-gold); border-radius: 8px; background: #faf6fb; width: 100%; }
.ticket-chip { display: inline-block; font-family: "Courier New", monospace; font-weight: 700; font-size: 1.15rem; padding: .25rem .8rem; margin: .15rem; border: 2px solid var(--lodge-gold); border-radius: 8px; background: var(--ticket-cream, #fcf6ec); color: var(--lodge-green); text-decoration: none; }
.ticket-state { display: inline-block; padding: .3rem .9rem; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.ticket-state.ok { background: #cfeedb; color: #14532d; }
.ticket-state.wait { background: #fff1c2; color: #7a5d00; }

/* ---- treasurer page ---- */
.bar-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.help-box { background: #faf6fb; border: 1px solid #e3d9e6; border-radius: 10px; padding: .6rem 1rem; margin: 1rem 0; }
.help-box summary { cursor: pointer; font-weight: 700; color: var(--lodge-green); }
.help-box ol { margin: .6rem 0 .2rem 1.2rem; padding: 0; line-height: 1.6; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; margin: .8rem 0 1.2rem; }
.tile { display: flex; align-items: center; gap: .7rem; background: #fff; border: 2px solid #e3d9e6; border-radius: 12px; padding: .7rem .9rem; text-decoration: none; color: inherit; }
.tile b { font-family: Georgia, serif; font-size: 1.8rem; color: var(--lodge-green); min-width: 2rem; text-align: center; }
.tile span { font-size: .85rem; line-height: 1.25; color: #5d5360; }
.tile small { color: #85788a; }
.tile.on { border-color: var(--lodge-green); box-shadow: 0 0 0 3px rgba(240,180,0,.45); }
.tile.hot b { color: #b45309; }
.bk { background: #fff; border: 1px solid #e3d9e6; border-left: 6px solid #cdbfd3; border-radius: 10px; padding: .9rem 1.1rem; margin-bottom: 1rem; }
.bk.need { border-left-color: #f0b400; background: #fffdf3; }
.bk-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.bk-ref { font-size: 1.25rem; font-weight: 700; color: var(--lodge-green); margin-right: .5rem; }
.bk-amt { font-size: 1.05rem; }
.bk-who { margin: .3rem 0 .1rem; }
.bk-meta { font-size: .82rem; color: #6b5f6b; }
.bk-note { margin: .6rem 0 0; padding: .5rem .8rem; background: #faf6fb; border-radius: 8px; font-size: .9rem; }
.bk-todo { margin: .6rem 0 0; padding: .6rem .8rem; background: #fff1c2; border-radius: 8px; font-size: .95rem; }
.btn.sm { padding: .2rem .7rem; font-size: .8rem; margin-left: .4rem; }
.bk-tickets { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0 .2rem; }
.tk { margin: 0; }
.tk label { display: flex; align-items: center; gap: .6rem; background: #fff; border: 2px solid #e3d9e6; border-radius: 10px; padding: .5rem .8rem; cursor: pointer; min-height: 3rem; }
.tk.on label { background: #eaf6ec; border-color: #5fbf7e; }
.tk input[type=checkbox] { width: 1.7rem; height: 1.7rem; flex: none; accent-color: #1b7f4b; cursor: pointer; }
.tk-no { font-size: 1.25rem; font-weight: 700; color: var(--lodge-green); }
.tk-lbl { font-size: .82rem; color: #5d5360; }
.bk-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .8rem; }
.bk-actions form { margin: 0; }
.bk-actions .btn { align-self: auto; }
.bk-actions button.link { background: none; border: 0; color: #8a1f1f; text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }
.pill { padding: .15rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eee; }
.pill.st-pending { background: #ece0f3; } .pill.st-review { background: #fff1c2; color: #7a5d00; } .pill.st-claimed { background: #cfeedb; color: #14532d; }
.pill.st-expired, .pill.st-cancelled { background: #eee; color: #777; }
.draw-card { border-left: 6px solid var(--lodge-gold); }
.draw-result { background: #faf6fb; border: 1px solid #e3d9e6; border-radius: 10px; padding: 1rem 1.2rem; }
.draw-result.won { background: #eaf6ec; border-color: #8fcf9a; }
.draw-h { font-family: Georgia, serif; font-size: 1.35rem; color: var(--lodge-green); margin-bottom: .5rem; }
.draw-table { border-collapse: collapse; }
.draw-table td { padding: .25rem 1.2rem .25rem 0; vertical-align: top; }
.draw-table td:first-child { color: #6b5f6b; font-size: .85rem; white-space: nowrap; }

/* ---- prize picture editor (admin) ---- */
.pe { border: 1px solid #e3d9e6; background: #faf6fb; border-radius: 12px; padding: .9rem 1rem; }
.pe-title { font-weight: 700; color: var(--lodge-green); }
.pe-help { font-size: .85rem; color: #6b5f6b; margin: .3rem 0 .6rem; }
.pe-panel { margin-top: .8rem; }
.pe-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.pe-mode { display: block; cursor: pointer; }
.pe-mode input { position: absolute; opacity: 0; pointer-events: none; }
.pe-mode span { display: block; padding: .6rem .8rem; border: 2px solid #cdbfd3; border-radius: 10px; background: #fff; line-height: 1.3; }
.pe-mode small { color: #6b5f6b; font-weight: 400; }
.pe-mode input:checked + span { border-color: var(--lodge-green); background: #fff8dc; box-shadow: 0 0 0 3px rgba(240,180,0,.4); }
.pe-aspects { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .6rem; font-size: .85rem; }
.pe-aspects button { font: inherit; font-size: .8rem; padding: .25rem .8rem; border: 1px solid var(--lodge-gold); background: #fff; color: var(--lodge-green); border-radius: 999px; cursor: pointer; }
.pe-aspects button.on { background: var(--lodge-green); color: var(--lodge-gold-bright); }
.pe-zoom { display: flex; align-items: center; gap: .8rem; font-size: .85rem; font-weight: 600; }
.pe-zoom input { flex: 1; }
.pe-previewlabel { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #8a6a00; margin: .8rem 0 .3rem; }
.pe-view { position: relative; width: 100%; overflow: hidden; border: 3px solid var(--lodge-gold); border-radius: 10px; background: #fff; touch-action: none; user-select: none; }
.pe-view.draggable { cursor: grab; }
.pe-view.draggable:active { cursor: grabbing; }
.pe-view img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; }

/* ---- QR downloads (admin) ---- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-top: .8rem; }
.qr-item { background: #fff; border: 1px solid #e3d9e6; border-radius: 10px; padding: .7rem; text-align: center; display: flex; flex-direction: column; gap: .3rem; }
.qr-item img { width: 100%; height: 210px; object-fit: contain; background: #f7f2f8; border-radius: 6px; }
.qr-item small { color: #6b5f6b; }
