:root {
  --red: #b3121f; --red-dark: #7a0c15; --red-bright: #d7263d;
  --ink: #1d1416; --muted: #6f6266; --bg: #f7f3ef; --card: #ffffff; --line: #e9e1db;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--red); }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 .4rem; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; word-break: break-all; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.2rem; background: var(--red-dark); color: #fff; }
.topbar .brand { color: #fff; text-decoration: none; font-weight: 700; }
.topbar .link { color: #f6d5d8; }
.drop { color: var(--red-bright); }
.container { max-width: 980px; margin: 1.5rem auto; padding: 0 16px; }
.narrow { max-width: 480px; margin: 2rem auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1.2rem; box-shadow: 0 1px 2px rgba(0,0,0,.03); overflow: hidden; }
.center { text-align: center; }
.empty { padding: 3rem 1.4rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.grid2 .card { margin-bottom: 0; }
.grid2 + .card { margin-top: 1.2rem; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .92rem; }
input, textarea { font: inherit; padding: .7rem .8rem; border: 1px solid #d8ccc4; border-radius: 10px; background: #fff; width: 100%; }
input:focus, textarea:focus { outline: 2px solid var(--red-bright); outline-offset: 1px; border-color: transparent; }
input[type=file] { padding: .5rem; }
.err { color: var(--red); font-weight: 500; font-size: .85rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.center-row { justify-content: center; margin-top: .8rem; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: .65rem 1.1rem; border-radius: 10px; border: 1px solid #d8ccc4; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--red); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.big { padding: .9rem 1.6rem; font-size: 1.05rem; }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; color: var(--red); }
.link.danger { color: var(--muted); }
.link.danger:hover { color: var(--red); }
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; background: #eef6ee; border: 1px solid #cfe5cf; }
.flash.error { background: #fdecee; border-color: #f4c3c9; color: var(--red-dark); }
.flash.info { background: #f2efe9; border-color: var(--line); }
.hero, .join { padding: 0; }
.cover { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.hero-body { padding: 1.4rem; }
.desc { white-space: normal; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--red); margin: 0 0 .3rem; }
.thumb { max-width: 220px; border-radius: 10px; }
.stat { font-size: 4.5rem; font-weight: 800; color: var(--red); line-height: 1; margin-top: .5rem; }
.spin-btn { margin-top: .8rem; letter-spacing: .05em; }
.winner-box { margin-top: 1rem; padding: 1rem; border-radius: 12px; background: #fff7e0; border: 1px solid #f1dc9a; }
.qr { width: 100%; max-width: 260px; aspect-ratio: 1; }
.list { width: 100%; border-collapse: collapse; }
.list th, .list td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--line); }
.list th { font-size: .8rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.list tr.win td { background: #fff7e0; font-weight: 700; }
@media (max-width: 560px) { .list th:nth-child(4), .list td:nth-child(4) { display: none; } }
.danger-zone { border-color: #f1c7cc; }
.logo-drop { font-size: 3rem; color: var(--red-bright); line-height: 1; }
.trophy { font-size: 3.5rem; }

/* wheel stage */
body.stage { background: radial-gradient(circle at 50% 30%, #5a0a10, #1a0305 70%); color: #fff; min-height: 100vh; }
body.stage .topbar { background: transparent; }
.wheel-page { max-width: 760px; margin: 0 auto; padding: 0 16px 3rem; text-align: center; position: relative; }
.back { position: absolute; left: 16px; top: 0; color: #f6d5d8; text-decoration: none; }
.stage-title { margin-top: 2rem; font-size: 2rem; }
.stage-sub { color: #e7b9be; margin-top: 0; }
.wheel-wrap { position: relative; width: min(88vw, 620px); margin: 1rem auto 1.6rem; }
.wheel-wrap canvas { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 30px rgba(0,0,0,.5)); }
.pointer { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 22px solid transparent; border-right: 22px solid transparent; border-top: 44px solid #ffd34d; z-index: 2; filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); }
.btn.huge { font-size: 1.4rem; padding: 1rem 2.4rem; letter-spacing: .08em; border-radius: 999px; background: #ffd34d; border-color: #ffd34d; color: #3b0207; box-shadow: 0 6px 24px rgba(255,211,77,.35); }
.btn.huge:hover { background: #ffe07a; }
.result { position: fixed; inset: 0; background: rgba(10,0,2,.7); display: grid; place-items: center; padding: 16px; z-index: 10; animation: fade .3s ease; }
.result[hidden] { display: none; }
.result-card { background: #fff; color: var(--ink); border-radius: 20px; padding: 2rem 2.4rem; max-width: 420px; width: 100%; animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
.result-card h2 { font-size: 2.2rem; color: var(--red); margin: .2rem 0; word-break: break-word; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* Overview of all raffles */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.page-head h1 { margin: 0; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1.6rem 0 .7rem; }
.raffle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.raffle-card { display: flex; flex-direction: column; padding: 0; margin: 0; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.raffle-card:hover { border-color: var(--red); transform: translateY(-2px); }
.raffle-card-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.raffle-card-cover.placeholder { display: grid; place-items: center; background: #f6eeea; font-size: 2.5rem; }
.raffle-card-body { padding: 1rem 1.1rem 1.1rem; }
.raffle-card-body h3 { margin: 0 0 .25rem; font-size: 1.1rem; }
.raffle-card-body .muted { margin: 0; font-size: .9rem; }
.raffle-card-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .8rem 0 0; font-size: .9rem; font-weight: 600; }
.badge { font-size: .75rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.badge.open { background: #eef6ee; color: #2f6b34; }
.badge.drawn { background: #fff7e0; color: #7a5a00; }
.crumb { margin: 0 0 .8rem; }
.crumb a { color: var(--muted); text-decoration: none; font-weight: 600; }
.crumb a:hover { color: var(--red); }
.privacy-note { margin: .6rem auto 0; max-width: 320px; font-size: .85rem; color: var(--muted); line-height: 1.4; }
