/* Holiday Raffle — shared styles */
:root {
  --app-version: "2026.12.02-2";
  --pine: #123f30;
  --pine-2: #1b5a44;
  --pine-3: #e6f0eb;
  --berry: #b3243b;
  --berry-2: #f8e3e6;
  --gold: #e0ad32;
  --gold-2: #fbf0d3;
  --ink: #1c2420;
  --muted: #66716b;
  --line: #dfe4e1;
  --bg: #f6f4ef;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: var(--pine-2); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- controls ---------- */
.btn {
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 550; white-space: nowrap;
}
.btn:hover { border-color: #b9c3be; background: #fafbfa; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn.primary:hover { background: var(--pine-2); }
.btn.danger { color: var(--berry); }
.btn.danger:hover { background: var(--berry-2); border-color: #e9b7bf; }
.btn.gold { background: var(--gold); border-color: #c9962a; color: #2b2208; }
.btn.sm { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn.link { border: 0; background: none; padding: 2px 4px; color: var(--pine-2); text-decoration: underline; }
input[type=text], input[type=number], input[type=password], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fff; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc7b6; outline-offset: 0; border-color: #7fb39f; }
input[type=number] { width: 90px; }
textarea { width: 100%; min-height: 110px; font-family: var(--mono); font-size: 13px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 550; }
label.field > input, label.field > select { color: var(--ink); font-size: 14px; font-weight: 400; }
label.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 650; letter-spacing: .02em; background: #eef0ef; color: #4b5650; }
.badge.High, .badge.settled, .badge.drawn { background: var(--gold-2); color: #7a5a08; }
.badge.Medium, .badge.open { background: var(--pine-3); color: var(--pine-2); }
.badge.Low, .badge.locked { background: #eceff3; color: #4c5866; }
.badge.Special { background: var(--berry-2); color: var(--berry); }
.badge.void { background: #f1f1f1; color: #999; text-decoration: line-through; }
.badge.server { background: var(--pine-3); color: var(--pine-2); }
.badge.local { background: var(--gold-2); color: #7a5a08; }

/* ---------- admin layout ---------- */
.adminhead { position: sticky; top: 0; z-index: 20; }
.topbar { background: var(--pine); color: #fff; padding: 12px 22px; display: flex; align-items: center; gap: 16px; }
.topbar h1 { font-size: 17px; font-weight: 700; }
.topbar .sub { opacity: .75; font-size: 12px; }
.topbar .spacer { flex: 1; }
.topbar select { background: var(--pine-2); color: #fff; border-color: #2f7259; }
.topbar .btn { background: transparent; color: #fff; border-color: #3d7b64; }
.topbar .btn:hover { background: var(--pine-2); }
.topbar .btn.gold { background: var(--gold); color: #2b2208; border-color: var(--gold); }
.tabs { display: flex; gap: 2px; padding: 0 22px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--pine); border-bottom-color: var(--pine); }
.tabs button:hover { color: var(--ink); }
main { padding: 20px 22px 60px; max-width: 1280px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 15px; margin-bottom: 10px; }
.card h3 { font-size: 13px; margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--muted); }

table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 6px 8px; border-bottom: 1px solid var(--line); background: #fbfcfb; position: sticky; top: 0; }
table.t td { padding: 6px 8px; border-bottom: 1px solid #eef1ef; vertical-align: middle; }
table.t tr:hover td { background: #fafcfb; }
table.t tr.void td { color: #aaa; text-decoration: line-through; }
table.t th.num { text-align: right; }
.scroll { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.amt-pos { color: var(--pine-2); font-weight: 600; }
.amt-neg { color: var(--berry); font-weight: 600; }

/* person picker */
.picker { border: 1px solid var(--line); border-radius: 8px; }
.picker .ph { display: flex; gap: 6px; padding: 6px; border-bottom: 1px solid var(--line); align-items: center; }
.picker .ph input { flex: 1; }
.picker .pl { max-height: 240px; overflow: auto; padding: 4px 0; columns: 2; column-gap: 0; }
.picker label { display: flex; gap: 6px; padding: 3px 10px; cursor: pointer; break-inside: avoid; font-size: 13px; }
.picker label:hover { background: #f3f6f4; }
.picker label .bal { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* games */
.game { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 14px; }
.game > header { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfcfb; border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.game > header h3 { margin: 0; font-size: 15px; }
.game .body { padding: 12px 14px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .game .body { grid-template-columns: 1fr; } }
.oddsrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px dashed #eceeed; }
.oddsrow .bar { height: 6px; background: var(--pine-3); border-radius: 3px; margin-top: 3px; overflow: hidden; }
.oddsrow .bar i { display: block; height: 100%; background: var(--pine-2); }
.oddsrow.win { background: var(--gold-2); border-radius: 6px; padding: 5px 6px; }
.mult { font-weight: 700; font-variant-numeric: tabular-nums; }

/* prizes */
.prize-row { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 12px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #eef1ef; }
.prize-row.sel { background: var(--pine-3); border-radius: 8px; }
.prize-row .nm { font-weight: 600; cursor: pointer; }
.winners { font-size: 12px; color: var(--pine-2); font-weight: 600; }

/* toast + modal */
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#toast div { background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 640px; animation: tin .2s ease-out; }
#toast div.err { background: var(--berry); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(15,25,20,.45); display: flex; align-items: center; justify-content: center; z-index: 90; }
.modal { background: #fff; border-radius: 12px; padding: 20px 22px; width: min(520px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { font-size: 17px; margin-bottom: 12px; }
.modal .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.notice { background: var(--gold-2); border: 1px solid #efd99b; border-radius: 8px; padding: 10px 12px; color: #5d4708; }
.notice.ok { background: var(--pine-3); border-color: #bdd9cc; color: var(--pine); }

/* ---------- public page ---------- */
body.public { background: linear-gradient(180deg, var(--pine) 0 220px, var(--bg) 220px); }
.pub-head { color: #fff; text-align: center; padding: 34px 20px 70px; }
.pub-head h1 { font-size: 30px; letter-spacing: -.01em; }
.pub-head p { opacity: .8; margin: 6px 0 0; }
.pub-wrap { max-width: 980px; margin: -50px auto 40px; padding: 0 16px; }
.lookup { display: flex; gap: 10px; }
.lookup input { flex: 1; font-size: 17px; padding: 12px 14px; }
.me { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.me .stat .v { font-size: 28px; }
@media (max-width: 640px) { .me { grid-template-columns: 1fr 1fr; } }
.daytabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.daytabs button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: 13px; }
.daytabs button.on { background: var(--pine); color: #fff; border-color: var(--pine); }

/* ---------- stage (screen share) ---------- */
body.stage {
  background: radial-gradient(ellipse at 50% 40%, #1d5a45 0%, #0d2b21 60%, #071a14 100%);
  color: #fff; height: 100vh; overflow: hidden; font-size: 16px;
}
.stage-wrap { display: grid; grid-template-columns: 1fr minmax(300px, 25vw); height: 100vh; }
.stage-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2vh 2vw; min-width: 0; }
.stage-title { position: absolute; top: 2.4vh; left: 2.5vw; right: 2.5vw; display: flex; align-items: baseline; gap: 16px; }
.stage-title .ev { font-size: 1.6vh; letter-spacing: .25em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.prize-name { font-size: 5.2vh; font-weight: 800; text-align: center; letter-spacing: -.01em; margin-top: 3vh; text-shadow: 0 3px 18px rgba(0,0,0,.35); }
.prize-sub { text-align: center; color: #cfe3da; font-size: 2vh; margin-top: .4vh; }
.wheel-box { position: relative; width: min(58vh, 50vw); aspect-ratio: 1; margin-top: 3.5vh; }
.wheel-box canvas { width: 100%; height: 100%; display: block; filter: drop-shadow(0 18px 40px rgba(0,0,0,.45)); }
.pointer { position: absolute; top: -2.2vh; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left: 2.2vh solid transparent; border-right: 2.2vh solid transparent; border-top: 4.4vh solid var(--gold);
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); z-index: 2; }
.hub { position: absolute; inset: 0; margin: auto; width: 17%; height: 17%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff4cf, var(--gold) 60%, #a77a14);
  box-shadow: 0 4px 16px rgba(0,0,0,.5), inset 0 -3px 6px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; color: #3a2a05; font-weight: 800; font-size: 2.2vh; text-align: center; line-height: 1.1; flex-direction: column; }
.ticker { height: 6.5vh; margin-top: 2.2vh; font-size: 4.6vh; font-weight: 800; color: #fff; text-align: center; min-width: 50%; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.ticker.dim { color: #9fbfb2; font-weight: 600; font-size: 2.4vh; padding-top: 2vh; }
.stage-side { background: rgba(0,0,0,.22); border-left: 1px solid rgba(255,255,255,.08); padding: 3vh 1.6vw; overflow: hidden; display: flex; flex-direction: column; }
.stage-side h3 { font-size: 1.5vh; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin: 0 0 1.2vh; }
.side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1vh; margin-bottom: 2.4vh; }
.side-stats div { background: rgba(255,255,255,.06); border-radius: 10px; padding: 1.2vh 1vw; }
.side-stats b { display: block; font-size: 3.2vh; font-variant-numeric: tabular-nums; }
.side-stats span { font-size: 1.4vh; color: #b9d3c8; }
.oddslist { flex: 1; overflow: hidden; position: relative; }
.oddslist .o { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: .55vh 0; font-size: 1.8vh; border-bottom: 1px solid rgba(255,255,255,.06); }
.oddslist .o span:last-child { color: #cfe3da; font-variant-numeric: tabular-nums; }
.oddslist .o.won { color: var(--gold); font-weight: 700; }
.lineup .li { display: grid; grid-template-columns: 1fr auto; padding: 1vh 0; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 2vh; gap: 10px; }
.lineup .li.cur { color: var(--gold); font-weight: 700; }
.lineup .li .w { grid-column: 1 / -1; font-size: 1.6vh; color: #9fd3bd; }
.lineup .li.done { opacity: .75; }
.stage-ctl { position: fixed; left: 1.5vw; bottom: 1.5vh; display: flex; gap: 8px; align-items: center; z-index: 30; opacity: .9; transition: opacity .3s; }
.stage-ctl.faded { opacity: 0; }
.stage-ctl select, .stage-ctl .btn { background: rgba(0,0,0,.45); color: #fff; border-color: rgba(255,255,255,.2); }
.stage-ctl .btn.gold { background: var(--gold); color: #2b2208; border-color: var(--gold); }
.stage-ctl .hint { font-size: 12px; color: #9fbfb2; }

.reveal { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(5,18,13,.78); z-index: 50; animation: fadein .35s ease-out; text-align: center; }
.reveal .lbl { color: var(--gold); letter-spacing: .3em; text-transform: uppercase; font-weight: 700; font-size: 2.2vh; }
.reveal .who { font-size: 11vh; font-weight: 900; line-height: 1.05; margin: 2vh 4vw; text-shadow: 0 6px 30px rgba(0,0,0,.5); animation: pop .6s cubic-bezier(.2,1.6,.4,1); }
.reveal .what { font-size: 3.6vh; color: #e6f3ed; }
.reveal .meta { font-size: 1.8vh; color: #9fbfb2; margin-top: 2vh; }
.reveal .go { margin-top: 4vh; }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.stage-empty { text-align: center; }
.stage-empty h2 { font-size: 6vh; font-weight: 900; }
.stage-empty p { color: #cfe3da; font-size: 2.2vh; }
.gate { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); z-index: 200; color: var(--ink); }
.grid2 > .card + .card, .grid3 > .card + .card { margin-top: 0; }
.grid2 + .card, .grid3 + .card { margin-top: 16px; }
/* surprise ("One more thing…") teaser */
body.teaser .stage-side { display: none; }
body.teaser .stage-wrap { grid-template-columns: 1fr; }
.omt-tease { font-size: 12vh !important; font-weight: 900; letter-spacing: -.02em;
  background: linear-gradient(90deg, #fff 0%, #f6d27a 40%, #fff 60%, #f6d27a 100%); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 4s linear infinite; }
@keyframes shimmer { to { background-position: -200% center; } }
body.teaser #prizeSel { display: none; }

/* ---------- participant page (me.html) ---------- */
.me-head { padding: 26px 16px 64px; }
.me-head .me-title { margin: 0; opacity: .75; letter-spacing: .2em; text-transform: uppercase; font-size: 12px; font-weight: 700; color: var(--gold); }
.me-head h1 { font-size: 26px; margin-top: 6px; }
.me-bal { margin-top: 10px; }
.me-bal b { display: block; font-size: 54px; line-height: 1; font-variant-numeric: tabular-nums; }
.me-bal span { opacity: .8; font-size: 13px; }
.me-sub { font-size: 13px; }
body.me-page { background: linear-gradient(180deg, var(--pine) 0 250px, var(--bg) 250px); }
.me-tabs { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; box-shadow: var(--shadow); margin-bottom: 14px; }
.me-tabs button { flex: 1; border: 0; background: none; padding: 10px 6px; border-radius: 9px; font-weight: 650; cursor: pointer; color: var(--muted); }
.me-tabs button.on { background: var(--pine); color: #fff; }
.prize-card.mine { border-color: #9cc7b6; box-shadow: 0 0 0 2px var(--pine-3), var(--shadow); }
.stepper { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stepper input { width: 84px; text-align: center; font-size: 18px; font-weight: 700; padding: 8px; }
.stepper .btn { padding: 9px 13px; font-size: 16px; }
.stepper .btn.primary { margin-left: auto; }
.betform { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.betform select { flex: 1 1 140px; }
.betform input { width: 100px; }
@media (max-width: 520px) { .pub-wrap { padding: 0 10px; } .card { padding: 14px; } }
body.public, body.me-page { min-height: 100vh; background-repeat: no-repeat; background-color: var(--bg); }
.side-stats .wide { grid-column: 1 / -1; }
.side-stats .wide b { font-size: 2.6vh; color: var(--gold); }
.chance-pill { text-align: center; margin-top: 1.2vh; }
.chance-pill span { display: inline-block; padding: .5vh 1.4vw; border-radius: 99px; font-weight: 800; font-size: 2.1vh; letter-spacing: .02em; }
.chance-pill .last { background: var(--gold); color: #2b2208; box-shadow: 0 0 24px rgba(224,173,50,.45); }
.chance-pill .more { background: rgba(255,255,255,.12); color: #e6f3ed; }

.prize-row .grip { cursor: grab; color: #9aa6a0; font-size: 18px; line-height: 1; padding: 6px 4px; touch-action: none; user-select: none; border-radius: 6px; }
.prize-row .grip:hover { color: var(--pine); background: var(--pine-3); }
.prize-row.dragging { background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.14); border-radius: 8px; position: relative; z-index: 5; outline: 2px solid #9cc7b6; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }

.prize-row .nm { display: inline-block; }
.prize-row .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.prize-row .winners { margin-top: 2px; }
.prize-row > span.num { white-space: nowrap; }
.day-h { margin: 18px 4px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
