/* GOATER Affiliate — sign-up page + partner back office (on top of style.css tokens) */
.px { --ok: #3ddc84; --warn: #ffb020; --bad: #ff5d5d; --glass: rgba(255, 255, 255, .05); --edge: rgba(255, 255, 255, .1); }
.px main { max-width: 1120px; margin: 0 auto; padding: 96px 16px 80px; }
.px h1, .px h2, .px h3 { margin: 0; }
.px .muted { color: var(--muted); }
.px .glass { background: var(--glass); border: 1px solid var(--edge); border-radius: 22px; padding: 22px; min-width: 0; }
.px .volt { color: var(--volt); }
.px .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.px .row2 > *, .px .grid3 > *, .px .grid4 > * { min-width: 0; }
.px .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.px .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.px label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.px input, .px select, .px textarea { font: inherit; color: var(--text, #fff); background: rgba(0, 0, 0, .35); border: 1px solid var(--edge); border-radius: 12px; padding: 12px 14px; width: 100%; min-width: 0; }
.px input:focus, .px textarea:focus { outline: 2px solid var(--volt); outline-offset: 1px; }
.px .hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.px .err { color: var(--bad); min-height: 1.2em; margin: 8px 0 0; }
.px .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--glass); border: 1px solid var(--edge); font-size: 13px; white-space: nowrap; }
.px .chip.volt { background: rgba(196, 255, 61, .12); border-color: rgba(196, 255, 61, .4); color: var(--volt); }
.px .bar { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.px .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7c3aed, var(--volt)); width: 0; transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.px .btn-sm { padding: 8px 14px; font-size: 14px; }

/* ---------- sign-up page ---------- */
.aff-hero { text-align: center; padding: 30px 0 10px; }
.aff-hero h1 { font-size: clamp(34px, 7vw, 72px); font-weight: 900; line-height: 1.05; letter-spacing: -.5px; }
.aff-hero h1 em { color: var(--volt); font-style: italic; }
.aff-hero p.lead { max-width: 640px; margin: 16px auto 0; color: var(--muted); font-size: 18px; }
.aff-hero .chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 22px 0; }
.aff-hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.aff-sec { margin-top: 56px; }
.aff-sec > h2 { font-size: clamp(24px, 4vw, 36px); font-weight: 900; margin-bottom: 18px; }
.step-card b { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--volt); color: #000; font-size: 20px; font-weight: 900; margin-bottom: 12px; }
.step-card p { color: var(--muted); margin: 6px 0 0; }
.tier-card { text-align: center; position: relative; overflow: hidden; }
.tier-card .emo { font-size: 46px; }
.tier-card .rate { font-size: 38px; font-weight: 900; color: var(--volt); line-height: 1; margin: 8px 0 4px; }
.tier-card small { color: var(--muted); }
.mini-list { display: grid; gap: 10px; }
.mini-list li { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .25); }
.mini-list .emo { font-size: 26px; }
.mini-list .grow { flex: 1; min-width: 0; }
.mini-list small { display: block; color: var(--muted); }
.signup { max-width: 760px; margin: 0 auto; }
.gate { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 16px; border-radius: 16px; border: 1px dashed rgba(6, 199, 85, .6); background: rgba(6, 199, 85, .08); margin-bottom: 18px; }
.gate.done { border-style: solid; }
.gate .grow { flex: 1 1 220px; }
.signup form { display: grid; gap: 14px; }
.signup .linkprev { font-family: ui-monospace, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.signup .ok { color: var(--ok); } .signup .no { color: var(--bad); }
.signup fieldset { border: 1px solid var(--edge); border-radius: 16px; padding: 14px; display: grid; gap: 12px; min-width: 0; }
.signup legend { padding: 0 6px; color: var(--muted); font-size: 14px; }
.check { display: flex !important; gap: 10px; align-items: flex-start; color: var(--text, #fff) !important; }
.check input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--volt); }

/* ---------- partner portal ---------- */
.pt-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(7, 6, 11, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--edge); }
.pt-top .logo img { height: 30px; }
.pt-top .me { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.pt-top .me b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 14px 16px 0; max-width: 1120px; margin: 0 auto; scrollbar-width: none; }
.pt-tabs button { font: inherit; flex: none; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--edge); background: var(--glass); color: inherit; cursor: pointer; }
.pt-tabs button.on { background: var(--volt); color: #000; border-color: var(--volt); font-weight: 700; }
.pt main { padding-top: 18px; }
.pt-view { display: grid; gap: 16px; }
.pt-view[hidden] { display: none !important; }
.wallet { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.wallet > * { min-width: 0; }
.money-card { background: radial-gradient(80% 120% at 100% 0%, rgba(196, 255, 61, .22), transparent 60%), linear-gradient(140deg, #1b1230, #0d0b14); border: 1px solid rgba(196, 255, 61, .3); border-radius: 22px; padding: 22px; }
.money-card .big { font-size: clamp(36px, 7vw, 56px); font-weight: 900; line-height: 1; margin: 6px 0; }
.money-card .subs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tier-prog { display: flex; gap: 16px; align-items: center; }
.tier-prog .emo { font-size: 54px; line-height: 1; flex: none; }
.tier-prog .grow { flex: 1; min-width: 0; }
.kpi4 b { display: block; font-size: 26px; font-weight: 800; margin-top: 4px; }
.kpi4 small { color: var(--muted); }
.linkbox { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.linkbox code { flex: 1 1 260px; min-width: 0; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .4); border: 1px solid var(--edge); font-size: 15px; overflow-wrap: anywhere; color: var(--volt); }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.share-row .btn { padding: 9px 14px; font-size: 14px; }
.qr-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.qr-wrap img { width: 132px; height: 132px; border-radius: 12px; background: #fff; padding: 8px; }
.spark { width: 100%; height: 140px; display: block; }
.spark .b { fill: #7c3aed; } .spark .b.on { fill: var(--volt); }
.spark text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.olist { display: grid; gap: 8px; }
.olist .o { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .25); }
.olist .o small { color: var(--muted); }
.olist .o .c { text-align: right; font-weight: 700; }
.olist .o.void { opacity: .5; text-decoration: line-through; }
.st-ok { color: var(--ok); } .st-wait { color: var(--warn); }

/* missions */
.missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mission { position: relative; overflow: hidden; border-radius: 22px; padding: 22px; background: linear-gradient(160deg, #1c1430, #0d0b14); border: 1px solid var(--edge); }
.mission .emo { font-size: 44px; line-height: 1; display: inline-block; }
.mission.active .emo { animation: bob 2.4s ease-in-out infinite; }
.mission h3 { font-size: 20px; margin: 10px 0 4px; }
.mission p { color: var(--muted); margin: 0 0 14px; }
.mission .nums { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0 0; font-size: 14px; }
.mission .nums b { font-size: 18px; }
.mission .rew { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.mission .time { font-size: 13px; color: var(--warn); margin-top: 10px; }
.mission.done { border-color: rgba(196, 255, 61, .55); background: radial-gradient(90% 90% at 100% 0%, rgba(196, 255, 61, .2), transparent 60%), linear-gradient(160deg, #1c1430, #0d0b14); }
.mission.done::after { content: 'พิชิตแล้ว!'; position: absolute; top: 18px; right: -34px; transform: rotate(35deg); background: var(--volt); color: #000; font-weight: 900; padding: 4px 40px; font-size: 13px; }
.mission.expired { opacity: .55; filter: grayscale(.6); }
.mission.waiting { border-color: rgba(255, 176, 32, .55); }
.mission.waiting .time { color: #ffd28a; }
.mission.upcoming { opacity: .8; }
.contest { border-radius: 22px; padding: 22px; background: radial-gradient(70% 120% at 0% 0%, rgba(255, 176, 32, .25), transparent 60%), linear-gradient(140deg, #23180a, #0d0b14); border: 1px solid rgba(255, 176, 32, .45); }
.contest h3 { font-size: 22px; }
.contest .cd { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.contest .cd span { min-width: 64px; text-align: center; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .35); }
.contest .cd b { display: block; font-size: 24px; font-weight: 900; }
.contest ul { margin: 10px 0 0; padding-left: 18px; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-6deg); } }

/* leaderboard */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--glass); border: 1px solid var(--edge); flex-wrap: wrap; }
.seg button { font: inherit; border: 0; background: none; color: inherit; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.seg button.on { background: var(--volt); color: #000; font-weight: 700; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; margin: 18px 0 8px; }
.podium > div { text-align: center; border-radius: 18px 18px 8px 8px; padding: 14px 8px; background: var(--glass); border: 1px solid var(--edge); min-width: 0; }
.podium .p1 { background: linear-gradient(180deg, rgba(255, 196, 0, .3), rgba(255, 196, 0, .05)); border-color: rgba(255, 196, 0, .6); padding-top: 26px; }
.podium .p2 { background: linear-gradient(180deg, rgba(200, 210, 230, .22), transparent); }
.podium .p3 { background: linear-gradient(180deg, rgba(205, 127, 50, .25), transparent); }
.podium .medal { font-size: 40px; line-height: 1; }
.podium .nm { font-weight: 800; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium small { color: var(--muted); }
.lb { display: grid; gap: 6px; }
.lb .r { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: rgba(0, 0, 0, .25); }
.lb .r.me { outline: 2px solid var(--volt); background: rgba(196, 255, 61, .08); }
.lb .rk { font-weight: 900; font-size: 18px; text-align: center; }
.lb .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-rank { position: sticky; bottom: 12px; }

/* rewards */
.rewards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.reward { display: grid; gap: 8px; text-align: center; padding: 20px; border-radius: 20px; background: var(--glass); border: 1px solid var(--edge); }
.reward .emo { font-size: 52px; line-height: 1; }
.reward .rw-img { width: 100%; aspect-ratio: 4 / 3; max-height: 150px; object-fit: cover; border-radius: 14px; background: rgba(0, 0, 0, .3); }
.reward .pts { font-size: 22px; font-weight: 900; color: var(--volt); }
.reward .need { font-size: 13px; color: var(--muted); }
.reward .bar { margin: 4px 0; height: 8px; }
.posts { display: grid; gap: 12px; }
.post summary { cursor: pointer; display: flex; gap: 12px; align-items: center; list-style: none; }
.post summary::-webkit-details-marker { display: none; }
.post .emo { font-size: 30px; flex: none; }
.post .body { white-space: pre-line; margin: 14px 0 0; line-height: 1.7; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badges .bd { display: grid; place-items: center; text-align: center; width: 92px; padding: 12px 6px; border-radius: 18px; background: rgba(196, 255, 61, .08); border: 1px solid rgba(196, 255, 61, .3); font-size: 12px; }
.badges .bd span { font-size: 34px; }

/* rewards: expiry, redemption history, redeem popup */
.exp-warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 176, 32, .12); border: 1px solid rgba(255, 176, 32, .45); color: #ffd28a; }
.rd-st { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); white-space: nowrap; }
.rd-approved, .rd-requested { color: var(--warn); } .rd-shipped { color: #8ec5ff; } .rd-sent { color: var(--ok); } .rd-rejected { color: var(--bad); }
.rd-steps { display: flex; gap: 4px; margin-top: 8px; max-width: 220px; }
.rd-steps i { flex: 1; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .12); }
.rd-steps i.on { background: var(--volt); } .rd-steps i.x { background: var(--bad); opacity: .5; }
.rd-head { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.rd-head img, .rd-head span { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; display: grid; place-items: center; font-size: 38px; background: rgba(0, 0, 0, .3); flex: none; }
.fee-box { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px; border-radius: 14px; background: rgba(196, 255, 61, .07); border: 1px solid rgba(196, 255, 61, .3); }
.fee-box img { width: 120px; height: 120px; border-radius: 10px; background: #fff; padding: 6px; flex: none; }
.drop-mini { display: grid !important; place-items: center; gap: 6px; padding: 14px; border-radius: 14px; border: 1px dashed var(--edge); cursor: pointer; text-align: center; color: var(--text, #fff) !important; }
.drop-mini.has { border-style: solid; border-color: var(--ok); }
.drop-mini img { max-height: 140px; border-radius: 10px; }

/* popups (withdraw, forgot password) */
.px-modal { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); }
.px-sheet { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #120f1c; }
.acct-pick { border: 1px solid var(--edge); border-radius: 14px; padding: 10px; display: grid; gap: 8px; min-width: 0; }
.acct-pick legend { padding: 0 6px; color: var(--muted); font-size: 14px; }
.acct { display: flex !important; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .3); color: var(--text, #fff) !important; overflow-wrap: anywhere; }
.acct input[type=radio] { width: 20px; height: 20px; flex: none; accent-color: var(--volt); }
.acct span { flex: 1; min-width: 0; }
.acct:has(input:checked) { outline: 2px solid var(--volt); }

/* login / pending */
.gate-page { max-width: 440px; margin: 40px auto; text-align: center; }
.gate-page form { display: grid; gap: 12px; text-align: left; margin-top: 18px; }

/* celebration */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall 2.6s cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); opacity: .9; } }
.toast-px { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%); z-index: 1000; padding: 12px 18px; border-radius: 14px; background: #1b1230; border: 1px solid rgba(196, 255, 61, .45); transition: transform .35s; max-width: calc(100vw - 32px); }
.toast-px.on { transform: translate(-50%, 0); }
.toast-px.bad { border-color: var(--bad); }

@media (max-width: 860px) {
  .px .grid3, .px .grid4 { grid-template-columns: 1fr 1fr; }
  .wallet { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .px main { padding-top: 84px; }
  .px .row2, .px .grid3 { grid-template-columns: 1fr; }
  .px .glass { padding: 18px; }
  .podium .medal { font-size: 30px; }
  .pt main { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .mission .emo, .confetti { animation: none !important; display: none; } }
