/* Spin & Win – V Perfumes. Brand colours taken from the approval deck. */
:root {
  --night: #140828;
  --night-2: #1d0d3a;
  --night-3: #2a1552;
  --violet: #5b2a9e;
  --violet-2: #7b3fc4;
  --royal: #1e3a8a;
  --gold: #d4b062;
  --gold-2: #c9a84c;
  --gold-deep: #9c7a2c;
  --cream: #f6f1e7;
  --paper: #fbf9f4;
  --ink: #1b1230;
  --ink-2: #4a3f63;
  --ink-3: #7a7090;
  --line: #e6dfd0;
  --ok: #1f7a4d;
  --ok-bg: #e5f4ec;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --bad: #a1262c;
  --bad-bg: #fbe7e8;
  --radius: 14px;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--violet); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ============ Staff / admin shell ============ */
.topbar { background: var(--night); color: var(--cream); border-bottom: 3px solid var(--gold-2); }
.topbar .in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 900; font-size: 22px; letter-spacing: .5px; color: var(--gold); text-decoration: none; white-space: nowrap; }
.brand small { font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: 2.5px; color: var(--cream); opacity: .75; margin-left: 8px; text-transform: uppercase; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--cream); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: .8; }
.nav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.nav a.on { background: var(--gold-2); color: var(--night); opacity: 1; }
.who { margin-left: auto; font-size: 13px; display: flex; align-items: center; gap: 10px; opacity: .9; }
.who b { color: var(--gold); font-weight: 600; }
.linkbtn { background: none; border: 1px solid rgba(255,255,255,.25); color: var(--cream); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.linkbtn:hover { border-color: var(--gold); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
.narrow { max-width: 720px; }
h1.page { font-family: var(--display); font-size: 30px; margin: 0 0 4px; }
.sub { color: var(--ink-3); margin: 0 0 22px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 0 rgba(27,18,48,.03), 0 8px 24px -16px rgba(27,18,48,.18); }
.card h2 { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px; font-weight: 700; }

label.f { display: block; margin-bottom: 16px; }
label.f > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
label.f > span em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.in-text { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 14px; font-size: 17px; outline: none; transition: border-color .15s, box-shadow .15s; }
.in-text:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(91,42,158,.12); }
.in-text.big { font-size: 22px; padding: 14px 16px; letter-spacing: 1px; }
.in-small { border: 1.5px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 14px; width: 100%; background: #fff; }
.in-small:focus { outline: none; border-color: var(--violet); }
.prefix { position: relative; }
.prefix > b { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; font-size: 15px; pointer-events: none; }
.prefix > .in-text { padding-left: 54px; }
.hint { font-size: 13px; color: var(--ink-3); margin-top: 6px; min-height: 18px; }
.hint.spins { color: var(--violet); font-weight: 700; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 13px 20px; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; transition: transform .05s, filter .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--violet); color: #fff; }
.btn.primary:hover:not([disabled]) { filter: brightness(1.1); }
.btn.gold { background: linear-gradient(180deg, #e2c27a, var(--gold-2)); color: var(--night); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--violet); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.mt { margin-top: 20px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.banner { border-radius: 10px; padding: 12px 14px; font-weight: 600; margin-bottom: 16px; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.info { background: #efe9fa; color: var(--violet); }

.badge { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 1px; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.mute { background: #eeebf3; color: var(--ink-2); }

/* Ticket result */
.ticket { text-align: center; }
.ticket .spins { font-family: var(--display); font-size: 56px; font-weight: 900; color: var(--violet); line-height: 1; }
.ticket .spins-l { letter-spacing: 3px; text-transform: uppercase; font-size: 12px; color: var(--ink-3); font-weight: 700; margin-bottom: 14px; }
.qr { width: 230px; max-width: 100%; margin: 6px auto 10px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qr svg { display: block; width: 100%; height: auto; }
.linkline { display: flex; gap: 6px; margin: 8px 0 14px; }
.linkline input { flex: 1; min-width: 0; font-size: 13px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink-2); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; text-align: left; font-size: 14px; margin: 14px 0 0; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 600; }
.empty { color: var(--ink-3); text-align: center; padding: 36px 10px; }
.empty .art { font-family: var(--display); font-size: 40px; color: var(--line); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--paper); }
table.t td.r, table.t th.r { text-align: right; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Redeem */
.reward-big { font-family: var(--display); font-size: 40px; font-weight: 900; color: var(--violet); line-height: 1.1; margin: 10px 0 6px; }
.instr { font-size: 18px; font-weight: 700; background: var(--cream); border-left: 4px solid var(--gold-2); padding: 12px 14px; border-radius: 8px; margin: 12px 0 4px; }
.done { text-align: center; padding: 10px 0 0; }
.done .tick { width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff; display: inline-grid; place-items: center; font-size: 30px; }
video.scan { width: 100%; border-radius: 12px; background: #000; margin-top: 12px; max-height: 320px; object-fit: cover; }

/* Admin */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 700; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button.on { color: var(--violet); border-color: var(--violet); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi .l { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.kpi .v { font-family: var(--display); font-size: 30px; font-weight: 900; margin-top: 2px; }
.total { font-weight: 800; padding: 8px 12px; border-radius: 8px; display: inline-block; }
.total.ok { background: var(--ok-bg); color: var(--ok); }
.total.bad { background: var(--bad-bg); color: var(--bad); }
.swatch { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.toggle input { width: 18px; height: 18px; accent-color: var(--violet); }
tr.off td { opacity: .5; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.subtabs button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.subtabs button.on { background: var(--night); color: var(--gold); border-color: var(--night); }
.mini-wheel { width: 220px; margin: 0 auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--night); color: var(--cream); padding: 12px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 50; max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); color: #fff; }
pre.json { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 12px; color: var(--ink-2); max-width: 520px; }

/* Login */
body.login { background: radial-gradient(1200px 600px at 80% -10%, #3a1d70 0%, var(--night) 55%); min-height: 100vh; display: grid; place-items: center; padding: 16px; color: var(--cream); }
.login-card { width: 100%; max-width: 380px; background: rgba(255,255,255,.04); border: 1px solid rgba(212,176,98,.35); border-radius: 18px; padding: 30px 26px; backdrop-filter: blur(6px); }
.login-card h1 { font-family: var(--display); font-size: 40px; margin: 0; color: var(--gold); line-height: 1; }
.login-card h1 + p { letter-spacing: 3px; text-transform: uppercase; font-size: 12px; font-weight: 700; opacity: .7; margin: 8px 0 24px; }
.login-card .in-text { background: rgba(255,255,255,.95); color: var(--ink); }
.login-card label.f > span { color: var(--cream); }

/* ============ Customer spin page ============ */
body.spin { background: var(--night); color: var(--cream); min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
body.spin::before { content: ""; position: fixed; inset: 0; background:
  radial-gradient(600px 400px at 50% 18%, rgba(123,63,196,.38), transparent 70%),
  radial-gradient(500px 380px at 10% 100%, rgba(30,58,138,.35), transparent 70%); pointer-events: none; }
.spin-shell { position: relative; max-width: 480px; margin: 0 auto; padding: 18px 16px 40px; text-align: center; }
.spin-shell::before, .spin-shell::after { content: ""; display: block; height: 3px; background: linear-gradient(90deg, transparent, var(--gold-2), transparent); margin: 0 -16px 14px; }
.spin-shell::after { margin: 28px -16px 0; }
.s-brand { letter-spacing: 4px; text-transform: uppercase; font-size: 11px; font-weight: 700; color: var(--gold); opacity: .9; }
.s-title { font-family: var(--display); font-weight: 900; font-size: 46px; line-height: .95; margin: 6px 0 4px; color: var(--gold); }
.s-title span { color: #fff; }
.s-sub { font-size: 14px; color: #cfc3e8; margin: 0 0 6px; }
.pips { display: inline-flex; gap: 8px; align-items: center; margin: 8px 0 4px; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(212,176,98,.3); font-weight: 700; font-size: 14px; }
.pip { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px rgba(212,176,98,.7); }
.pip.used { background: transparent; border: 2px solid rgba(212,176,98,.45); box-shadow: none; }

.wheel-box { position: relative; width: min(88vw, 400px); aspect-ratio: 1; margin: 14px auto 18px; }
.wheel-box svg.wheel { width: 100%; height: 100%; display: block; will-change: transform; filter: drop-shadow(0 18px 40px rgba(0,0,0,.55)); }
.pointer { position: absolute; left: 50%; top: -6px; width: 34px; height: 44px; transform: translateX(-50%); z-index: 3; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.hub { position: absolute; left: 50%; top: 50%; width: 24%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #3b1f6e, var(--night) 70%); border: 4px solid var(--gold-2); display: grid; place-items: center;
  box-shadow: 0 0 0 3px rgba(20,8,40,.6), inset 0 0 18px rgba(0,0,0,.6); }
.hub b { font-family: var(--display); color: var(--gold); font-size: clamp(16px, 5vw, 24px); line-height: 1; }
.hub small { display: block; font-size: 8px; letter-spacing: 2px; color: #cfc3e8; margin-top: 3px; }
.bulb { fill: #fff3cf; }
.wheel-box.spinning .bulb { animation: blink .5s steps(2, end) infinite; }
.wheel-box.spinning .bulb:nth-child(2n) { animation-delay: .25s; }
@keyframes blink { 50% { fill: #9c7a2c; } }

.spin-btn { position: relative; width: 100%; max-width: 320px; padding: 18px 20px; border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--display); font-weight: 900; font-size: 26px; letter-spacing: 4px; color: var(--night);
  background: linear-gradient(180deg, #f0d48d, var(--gold-2) 55%, var(--gold-deep)); box-shadow: 0 8px 0 #6f561f, 0 14px 30px rgba(0,0,0,.45); }
.spin-btn:active:not([disabled]) { transform: translateY(5px); box-shadow: 0 3px 0 #6f561f, 0 8px 18px rgba(0,0,0,.45); }
.spin-btn[disabled] { filter: grayscale(.4) brightness(.8); cursor: default; }
.s-msg { margin: 16px auto 0; max-width: 360px; font-size: 15px; color: #e9e1f7; }
.s-msg.bad { color: #ffb4b8; }
.retry { margin-top: 10px; background: none; border: 1.5px solid var(--gold); color: var(--gold); border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer; }

.result { margin: 22px 0 0; background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); border: 1.5px solid var(--gold-2); border-radius: 20px; padding: 22px 18px; animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
.result.nowin { border-color: rgba(212,176,98,.35); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.result .k { letter-spacing: 3px; text-transform: uppercase; font-size: 11px; font-weight: 700; color: var(--gold); }
.result .prize { font-family: var(--display); font-size: 38px; font-weight: 900; color: #fff; line-height: 1.05; margin: 6px 0 12px; }
.code-box { background: #fff; color: var(--night); border-radius: 14px; padding: 14px 12px 12px; }
.code-box .code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 800; font-size: clamp(26px, 8.4vw, 36px); letter-spacing: 2px; }
.code-box .qr-sm { width: 132px; margin: 8px auto 0; }
.code-box .qr-sm svg { width: 100%; height: auto; display: block; }
.show-cashier { margin-top: 12px; font-weight: 800; font-size: 17px; color: var(--gold); }
.result small.exp { display: block; margin-top: 6px; color: #cfc3e8; }

.mine { margin-top: 26px; text-align: left; }
.mine h3 { letter-spacing: 3px; text-transform: uppercase; font-size: 11px; color: var(--gold); margin: 0 0 8px; text-align: center; }
.mine li { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: rgba(255,255,255,.05); margin-bottom: 8px; }
.mine ul { padding: 0; margin: 0; }
.mine .nm { font-weight: 700; }
.mine .cd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: #cfc3e8; }
.tag { font-size: 10px; font-weight: 800; letter-spacing: 1px; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; white-space: nowrap; }
.tag.ok { background: rgba(212,176,98,.2); color: var(--gold); }
.tag.used { background: rgba(255,255,255,.12); color: #cfc3e8; }
.tag.bad { background: rgba(161,38,44,.35); color: #ffc9cc; }
.terms { font-size: 12px; color: #9d90bb; margin-top: 18px; }
.loading { padding: 80px 0; color: #cfc3e8; }

@media (prefers-reduced-motion: reduce) {
  .result { animation: none; }
  .wheel-box.spinning .bulb { animation: none; }
}
@media print { .topbar, .nav, .btn { display: none !important; } }
select.in-small { min-width: 140px; }
input[type=date].in-small { width: auto; min-width: 150px; }
