/* BazaarKamer design tokens — Brand System v2.0 */
:root {
  --green: #006B3F;
  --green-700: #005432;
  --green-900: #0B3D2A;
  --green-50: #E7F3EC;
  --red: #EC1126;
  --red-50: #FDE8EA;
  --yellow: #FCD116;
  --yellow-600: #E5BA00;
  --yellow-50: #FFF6D1;
  --light: #FFF8E6;
  --text: #1E293B;
  --muted: #64748B;
  --line: #E7E2D3;
  --white: #FFFFFF;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .18);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--light); line-height: 1.55; font-size: 15px; }
img, svg { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.section { padding-top: 28px; padding-bottom: 28px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; word-break: break-all; }

/* ---------- Demo / legal banner ---------- */
.mode-banner { background: var(--yellow); color: var(--text); font-size: .8rem; text-align: center; padding: 6px 16px; font-weight: 500; }
.mode-banner a { color: var(--text); text-decoration: underline; }

/* ---------- Header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.site-header .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 800; font-size: 1.15rem; text-decoration: none !important; }
.brand img { width: 40px; height: 40px; }
.brand .k { color: var(--red); }
.nav { display: none; gap: 4px; margin-left: 12px; }
.nav a { color: var(--text); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .92rem; }
.nav a:hover, .nav a.active { color: var(--green); background: var(--green-50); text-decoration: none; }
.header-search { display: none; flex: 1; max-width: 240px; margin-left: auto; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lang { font-size: .8rem; font-weight: 600; color: var(--muted); }
.lang a { color: var(--muted); padding: 2px 4px; }
.lang a.on { color: var(--green); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--text); }
.icon-btn:hover { background: var(--green-50); }
.dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--white); }
@media (min-width: 900px) {
  .nav, .header-search { display: flex; }
  .header-actions { margin-left: 0; }
}
@media (min-width: 900px) and (max-width: 1150px) { .header-search { display: none; } }
@media (max-width: 599px) {
  .header-actions .lang, .header-actions .admin-link { display: none; }
  .site-header .container { gap: 8px; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: var(--radius-sm); border: 2px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; transition: transform .08s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-700); }
.btn-cta { background: var(--yellow); color: var(--text); }
.btn-cta:hover { background: var(--yellow-600); }
.btn-red { background: var(--red); color: var(--white); }
.btn-outline { border-color: var(--green); color: var(--green); background: transparent; }
.btn-outline:hover { background: var(--green-50); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-light { background: transparent; border-color: rgba(255,255,255,.7); color: var(--white); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=search], input[type=date], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--green-50); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.error { color: var(--red); font-size: .82rem; margin-top: 4px; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.grid-2 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Alerts / badges ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .92rem; border-left: 4px solid; }
.alert-success { background: var(--green-50); border-color: var(--green); }
.alert-error { background: var(--red-50); border-color: var(--red); }
.alert-warn { background: var(--yellow-50); border-color: var(--yellow-600); }
.alert ul { margin: 0; padding-left: 18px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--green-50); color: var(--green); white-space: nowrap; }
.badge-red { background: var(--red); color: var(--white); }
.badge-yellow { background: var(--yellow); color: var(--text); }
.badge-gray { background: #EEF0F3; color: var(--muted); }
.badge-soft-red { background: var(--red-50); color: #B00C1C; }

/* ---------- Cards ---------- */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,.03); }
.card-body { padding: 18px; }
.grid-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }

.raffle-card { display: flex; flex-direction: column; overflow: hidden; color: var(--text); text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.raffle-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.raffle-card .media { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #F7F1DF, #FFFDF7); display: grid; place-items: center; }
.raffle-card .media img { width: 100%; height: 100%; object-fit: cover; }
.raffle-card .media img.illus { width: 62%; height: 62%; object-fit: contain; }
.raffle-card .media .badge { position: absolute; top: 10px; left: 10px; }
.raffle-card .media .illus-tag { position: absolute; bottom: 8px; right: 8px; font-size: .62rem; background: rgba(255,255,255,.85); color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.raffle-card .body { padding: 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.raffle-card .title { font-weight: 700; font-size: .98rem; }
.raffle-card .price { color: var(--red); font-weight: 700; font-size: 1.05rem; margin-top: 2px; }
.price small { color: var(--muted); font-weight: 400; font-size: .78rem; }

.progress { height: 8px; background: #EDEAE0; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.progress-meta { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: 4px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; color: var(--white); background:
  radial-gradient(1200px 500px at 85% 20%, rgba(252, 209, 22, .18), transparent 60%),
  radial-gradient(800px 400px at 10% 100%, rgba(236, 17, 38, .18), transparent 60%),
  linear-gradient(135deg, var(--green-900), var(--green)); }
.hero .container { display: grid; gap: 28px; padding-top: 36px; padding-bottom: 36px; align-items: center; }
.hero h1 { color: var(--white); font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.5px; }
.hero h1 .y { color: var(--yellow); display: block; }
.hero .lead { font-size: 1.05rem; opacity: .92; max-width: 34ch; }
.hero .tagline { font-style: italic; color: var(--yellow); font-weight: 600; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: .8rem; opacity: .95; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-art { display: none; }
@media (min-width: 900px) {
  .hero .container { grid-template-columns: 1.1fr .9fr; padding-top: 52px; padding-bottom: 52px; }
  .hero-art { display: block; }
}
.hero-feature { background: var(--white); color: var(--text); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-lg); max-width: 400px; justify-self: end; width: 100%; }
.hero-feature .media { aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #F7F1DF, #FFFDF7); display: grid; place-items: center; margin-bottom: 12px; }
.hero-feature .media img { width: 100%; height: 100%; object-fit: cover; }
.hero-feature .media img.illus { width: 55%; height: 80%; object-fit: contain; }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 12px 0; }
.countdown div { background: var(--light); border-radius: 10px; padding: 6px 2px; }
.countdown b { display: block; font-size: 1.15rem; }
.countdown span { font-size: .66rem; color: var(--muted); }

/* ---------- Chips / tabs ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); color: var(--text); font-size: .85rem; font-weight: 500; }
.chip:hover { text-decoration: none; border-color: var(--green); }
.chip.on { background: var(--green); border-color: var(--green); color: var(--white); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--green); border-color: var(--green); }
.tabs a:hover { text-decoration: none; color: var(--green); }

/* ---------- Detail page ---------- */
.detail { display: grid; gap: 20px; }
@media (min-width: 960px) { .detail { grid-template-columns: 1.3fr 1fr; align-items: start; } .sticky { position: sticky; top: 84px; } }
@media (max-width: 959px) {
  .detail { display: flex; flex-direction: column; }
  .detail > .stack { display: contents; }
  .detail > .stack > * { order: 2; margin-top: 0; }
  .detail > .stack > .gallery { order: 0; }
  .detail > aside { order: 1; }
}
.gallery { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, #F7F1DF, #FFFDF7); display: grid; place-items: center; position: relative; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery img.illus { width: 55%; height: 70%; object-fit: contain; }
.facts { display: grid; grid-template-columns: 1fr; gap: 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.feature-list svg { flex: none; color: var(--green); margin-top: 2px; }
details.rule { border-bottom: 1px solid var(--line); padding: 12px 0; }
details.rule summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
details.rule summary::after { content: '+'; color: var(--green); font-weight: 700; }
details.rule[open] summary::after { content: '–'; }
details.rule p { margin: 8px 0 0; color: #334155; font-size: .9rem; white-space: pre-line; }

/* ---------- Checkout ---------- */
.qty { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; width: max-content; background: var(--white); }
.qty button { width: 54px; height: 50px; border: 0; background: var(--white); font-size: 1.4rem; cursor: pointer; color: var(--text); }
.qty button:hover { background: var(--green-50); }
.qty input { width: 80px; border: 0; border-left: 1.5px solid var(--line); border-right: 1.5px solid var(--line); border-radius: 0; text-align: center; font-size: 1.3rem; font-weight: 700; min-height: 50px; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.total { font-size: 1.9rem; font-weight: 800; color: var(--red); }
.pay-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; background: var(--white); font-weight: 500; }
.pay-option:has(input:checked) { border-color: var(--green); background: var(--green-50); }
.pay-option input { accent-color: var(--green); width: 18px; height: 18px; }
.pay-option.off { opacity: .55; cursor: not-allowed; }
.pay-logo { width: 34px; height: 24px; border-radius: 5px; display: grid; place-items: center; font-size: .6rem; font-weight: 800; color: var(--white); }

/* ---------- Tickets ---------- */
.ticket-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tkt { position: relative; background: var(--green-50); border: 1.5px dashed var(--green); border-radius: 10px; padding: 8px 6px; text-align: center; }
.tkt b { display: block; color: var(--green); font-size: .95rem; }
.tkt span { font-size: .68rem; color: var(--muted); }
.tkt.refunded { background: #F1F5F9; border-color: #94A3B8; }
.tkt.refunded b { color: var(--muted); }
.tkt.win { background: var(--yellow-50); border-color: var(--yellow-600); }

/* ---------- Draw ---------- */
.draw-stage { background: radial-gradient(600px 300px at 50% 30%, rgba(252,209,22,.25), transparent 70%), linear-gradient(180deg, var(--green-900), var(--green)); color: var(--white); border-radius: 20px; padding: 28px 18px; text-align: center; overflow: hidden; position: relative; }
.draw-stage h1, .draw-stage h2 { color: var(--white); }
.bucket-wrap { width: min(280px, 70vw); margin: 10px auto; position: relative; }
.bucket-wrap.mixing svg .tix { animation: mix .5s ease-in-out infinite alternate; transform-origin: 50% 60%; }
.bucket-wrap.mixing svg { animation: shake .35s ease-in-out infinite; }
@keyframes mix { from { transform: rotate(-6deg) translateY(2px); } to { transform: rotate(6deg) translateY(-6px); } }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
.reveal-ticket { display: inline-block; background: var(--yellow); color: var(--text); font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 800; padding: 10px 26px; border-radius: 14px; transform: scale(.6); opacity: 0; transition: transform .5s cubic-bezier(.2, 1.6, .4, 1), opacity .4s; }
.reveal-ticket.show { transform: scale(1); opacity: 1; }
.stages { list-style: none; padding: 0; margin: 18px auto 0; max-width: 300px; text-align: left; display: grid; gap: 10px; }
.stages li { display: flex; gap: 10px; align-items: center; opacity: .55; font-size: .9rem; }
.stages li.done, .stages li.now { opacity: 1; }
.stages li i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--yellow); display: grid; place-items: center; font-style: normal; font-size: .7rem; flex: none; }
.stages li.done i { background: var(--yellow); color: var(--text); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -10px; width: 8px; height: 14px; animation: fall 2.6s linear forwards; }
@keyframes fall { to { transform: translateY(520px) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid #F1EEE4; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }

/* ---------- Footer & mobile tab bar ---------- */
.site-footer { background: var(--green-900); color: rgba(255,255,255,.82); padding: 36px 0 90px; margin-top: 40px; font-size: .88rem; }
.site-footer a { color: rgba(255,255,255,.9); }
.site-footer .cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.site-footer h4 { color: var(--yellow); font-size: .9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.flag-bar { height: 5px; background: linear-gradient(90deg, var(--green) 33.3%, var(--red) 33.3% 66.6%, var(--yellow) 66.6%); }
@media (min-width: 900px) { .site-footer { padding-bottom: 36px; } }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: var(--white); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; color: var(--muted); font-weight: 500; padding: 4px 0; }
.tabbar a.on { color: var(--red); }
.tabbar a:hover { text-decoration: none; }
@media (min-width: 900px) { .tabbar { display: none; } }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 28px 16px 100px; }
.auth-card { width: 100%; max-width: 440px; }

/* ---------- Pagination ---------- */
nav[role=navigation] { margin-top: 20px; }
nav[role=navigation] svg { width: 18px; height: 18px; display: inline; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; }
.pager a, .pager span { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); font-size: .85rem; }
.pager span.on { background: var(--green); color: var(--white); border-color: var(--green); }
.pager span.off { color: var(--muted); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty img { width: 96px; margin: 0 auto 12px; opacity: .9; }

/* ---------- Admin ---------- */
.admin { display: grid; grid-template-columns: 1fr; min-height: 100vh; background: #F6F7F4; }
.admin-side { background: var(--green-900); color: var(--white); padding: 16px; }
.admin-side .brand { color: var(--white); margin-bottom: 14px; }
.admin-side nav { display: flex; gap: 4px; overflow-x: auto; }
.admin-side nav a { color: rgba(255,255,255,.85); padding: 9px 12px; border-radius: 10px; font-size: .88rem; display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.admin-side nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.admin-side nav a.on { background: var(--green); color: var(--white); font-weight: 600; }
.admin-main { padding: 18px 16px 40px; min-width: 0; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
@media (min-width: 1000px) {
  .admin { grid-template-columns: 240px 1fr; }
  .admin-side { min-height: 100vh; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .admin-side nav { flex-direction: column; overflow: visible; }
  .admin-main { padding: 26px 30px 50px; }
}
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.stat { border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 1.5rem; font-weight: 800; margin-top: 8px; }
.stat span { font-size: .78rem; color: var(--muted); }
.stat.g { background: var(--green-50); } .stat.r { background: var(--red-50); } .stat.y { background: var(--yellow-50); } .stat.b { background: #E8F0FB; }
.queue { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.queue:last-child { border-bottom: 0; }
.chart svg { width: 100%; height: auto; }
.gate { display: flex; align-items: center; gap: 8px; font-size: .88rem; padding: 6px 0; }
.gate .ok { color: var(--green); } .gate .no { color: var(--red); }

/* Sales bar notes and draw time */
.progress.fill-middle > span { background: linear-gradient(90deg, var(--green), #F2B705); }
.progress.fill-last > span { background: linear-gradient(90deg, #F2B705, var(--red)); }
.fill-note { font-size: .78rem; font-weight: 600; margin-top: 5px; }
.fill-note-early { color: var(--green); }
.fill-note-middle { color: #9A6B00; }
.fill-note-last { color: var(--red); }
.buy-nudge { margin-top: 8px; text-align: center; font-size: .82rem; font-weight: 700; padding: 6px 10px; border-radius: 10px; }
.buy-nudge-early { background: #E6F4EC; color: var(--green); }
.buy-nudge-middle { background: #FFF6D6; color: #8A5E00; }
.buy-nudge-last { background: #FDE7EA; color: var(--red); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .buy-nudge-last { animation: none; } }
.draw-time { margin-top: 8px; font-size: .8rem; }
.draw-time-when b { font-weight: 700; }
.draw-time-left { font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Draw simulator */
.sim-form { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 14px 0 4px; }
.sim-form label { width: 100%; font-weight: 600; }
.sim-form input { width: 110px; text-align: center; font-size: 1.1rem; padding: 8px; border-radius: 10px; border: 0; }
.sim-history { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font-size: .78rem; }
.sim-history b { background: rgba(255,255,255,.15); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.sim-steps { padding-left: 20px; } .sim-steps li { margin-bottom: 6px; }
.fair-chart { margin-top: 12px; display: grid; gap: 4px; }
.fair-chart div { display: grid; grid-template-columns: 70px 1fr 50px; gap: 8px; align-items: center; font-size: .78rem; }
.fair-chart i { display: block; height: 12px; background: var(--green); border-radius: 6px; }
.fair-chart b { text-align: right; font-variant-numeric: tabular-nums; }

/* Demo draw scene on the homepage */
.mix-scene { background: radial-gradient(600px 300px at 50% 30%, rgba(252,209,22,.25), transparent 70%), linear-gradient(180deg, var(--green-900), var(--green)); color: var(--white); border-radius: 20px; padding: 24px 16px; text-align: center; position: relative; overflow: hidden; }
.mix-scene h2 { color: var(--white); margin: 10px 0 4px; }
.mix-caption { opacity: .9; min-height: 1.5em; }
.mix-bucket { width: min(260px, 66vw); margin: 0 auto; position: relative; }
.mix-bucket svg { position: relative; z-index: 1; }
.mix-scene.mixing .mix-bucket svg { animation: shake .35s ease-in-out infinite; }
.mix-scene.mixing .mix-bucket svg .tix { animation: mix .5s ease-in-out infinite alternate; transform-origin: 50% 60%; }
.mix-tix { position: absolute; left: 12%; right: 12%; top: 22%; height: 34%; z-index: 2; pointer-events: none; }
.mix-tix i { position: absolute; left: var(--x); bottom: 0; width: 18px; height: 30px; border-radius: 4px; background: var(--c); box-shadow: 0 1px 3px rgba(0,0,0,.3); opacity: 0; }
.mix-scene.mixing .mix-tix i { animation: tumble 1.4s ease-in-out var(--d) infinite; }
@keyframes tumble {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  50% { transform: translate(22px, -95px) rotate(200deg); }
  85% { opacity: 1; }
  100% { transform: translate(-14px, 0) rotate(380deg); opacity: 0; }
}
.mix-card { display: flex; width: fit-content; margin-left: auto; margin-right: auto; flex-direction: column; gap: 2px; background: var(--yellow); color: var(--text); border-radius: 14px; padding: 10px 26px; margin-top: -10px; position: relative; z-index: 3; transform: translateY(60px) scale(.4); opacity: 0; transition: transform .6s cubic-bezier(.2, 1.6, .4, 1), opacity .4s; }
.mix-card b { font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1.1; }
.mix-card small { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.mix-card span { font-weight: 600; }
.mix-scene.picked .mix-card { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .mix-scene.mixing .mix-tix i, .mix-scene.mixing .mix-bucket svg, .mix-scene.mixing .mix-bucket svg .tix { animation: none; } }

/* AI help chat */
.ai-chat { position: fixed; right: 14px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 60; }
@media (min-width: 900px) { .ai-chat { bottom: 22px; right: 22px; } }
.ai-chat-bubble { display: flex; align-items: center; gap: 6px; border: 0; cursor: pointer; background: var(--green); color: var(--white); font: inherit; font-weight: 700; padding: 12px 16px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.ai-chat-bubble:hover { background: var(--green-900); }
@media (max-width: 599px) { .ai-chat-bubble-label { display: none; } .ai-chat-bubble { padding: 14px; font-size: 1.2rem; } }
.ai-chat.open .ai-chat-bubble { display: none; }
.ai-chat-panel { width: min(380px, calc(100vw - 28px)); height: min(560px, calc(100vh - 120px)); background: var(--white); border-radius: 18px; box-shadow: 0 16px 48px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; }
.ai-chat-panel[hidden] { display: none; }
.ai-chat-head { display: flex; align-items: center; gap: 6px; padding: 12px 14px; background: linear-gradient(135deg, var(--green-900), var(--green)); color: var(--white); }
.ai-chat-head > div { flex: 1; display: flex; flex-direction: column; }
.ai-chat-head small { opacity: .85; font-size: .72rem; display: flex; align-items: center; gap: 5px; }
.ai-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; display: inline-block; }
.ai-chat-icon { background: rgba(255,255,255,.15); color: var(--white); border: 0; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 1rem; }
.ai-chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #FAF8F2; }
.ai-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: .88rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg a { color: inherit; text-decoration: underline; }
.ai-msg-bot { background: var(--white); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg-user { background: var(--green); color: var(--white); align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-msg-error { border-color: #F5B5BE; background: #FFF4F5; }
.ai-typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: aiTyping 1s infinite ease-in-out; }
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aiTyping { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-chat-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; border-top: 1px solid var(--line); }
.ai-chat-chips button { flex: none; border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 5px 10px; font: inherit; font-size: .76rem; cursor: pointer; }
.ai-chat-chips button:hover { border-color: var(--green); color: var(--green); }
.ai-chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.ai-chat-form input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: .86rem; }
.ai-chat-note { margin: 0; padding: 0 10px 8px; font-size: .66rem; color: var(--muted); text-align: center; }
