:root {
  --bg: #0b0b0d; --panel: #15151a; --panel2: #1c1c23; --line: #2a2a33;
  --text: #f2efe6; --muted: #9a968a; --gold: #d4af37; --gold2: #f1d77a;
  --green: #3ecf8e; --red: #ff6b6b; --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: radial-gradient(1200px 500px at 50% -120px, #1a160a 0%, var(--bg) 60%) no-repeat var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100dvh; }
#app { max-width: 760px; margin: 0 auto; padding: 14px 14px calc(28px + env(safe-area-inset-bottom)); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: .2px; }
h1 { font-size: 22px; font-family: Georgia, "Times New Roman", serif; letter-spacing: .5px; } h2 { font-size: 18px; } h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.gold { color: var(--gold); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.center { min-height: 70dvh; display: grid; place-items: center; text-align: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.top { display: flex; align-items: center; gap: 10px; padding: 6px 0 14px; }
.top .brand { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 19px; letter-spacing: 2px; flex: 1; }
.top .mark { height: 31px; width: 54px; object-fit: cover; border-radius: 7px; border: 1px solid #3a321a; }
.top { border-bottom: 1px solid var(--line); margin-bottom: 14px; padding-bottom: 12px; }
.logo { text-align: center; padding: 10px 0 16px; }
.logo img { width: 220px; height: 220px; border-radius: 26px; border: 1px solid #3a321a; box-shadow: 0 18px 50px rgba(212,175,55,.14); }
.sponsor { margin-top: 28px; padding: 18px 0 6px; border-top: 1px solid var(--line); text-align: center; }
.sponsor span { display: block; font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.sponsor img { height: 51px; width: auto; opacity: .92; }
.sponsor a:active img { opacity: 1; }
.top .who { text-align: right; font-size: 12px; color: var(--muted); line-height: 1.2; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 6px 22px rgba(0,0,0,.35); }
.card.hero { background: linear-gradient(145deg, #241f0f, #15151a 62%); border-color: #5a4c1b; box-shadow: 0 10px 34px rgba(212,175,55,.10); }
.balance { font-size: 40px; font-weight: 800; color: var(--gold2); font-variant-numeric: tabular-nums; line-height: 1.1; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px; font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
input.big { font-size: 28px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }

button { font: inherit; cursor: pointer; border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 700; color: var(--text); background: var(--panel2); border: 1px solid var(--line); min-height: 48px; }
button:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1a1505; border-color: transparent; }
button.danger { color: var(--red); }
button.ghost { background: transparent; }
button.block { width: 100%; }
button.sm { min-height: 36px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.back { background: transparent; border: 0; color: var(--muted); padding: 6px 0; min-height: 0; font-weight: 600; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.action { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px; }
.action b { font-size: 16px; } .action span { font-size: 12px; color: var(--muted); font-weight: 500; }

.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item.tap { cursor: pointer; } .item.tap:active { background: var(--panel2); }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.pos { color: var(--green); } .amt.neg { color: var(--text); }
.struck { text-decoration: line-through; opacity: .55; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.pill.ok { color: var(--green); border-color: #1f5a41; } .pill.bad { color: var(--red); border-color: #6b2b2b; } .pill.gold { color: var(--gold); border-color: #4a3f17; }

.qty { display: flex; align-items: center; gap: 8px; }
.qty button { min-height: 38px; width: 38px; padding: 0; font-size: 20px; }
.qty b { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.cartbar { position: sticky; bottom: 10px; margin-top: 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tabs button { min-height: 40px; padding: 8px 14px; white-space: nowrap; }
.tabs button.on { border-color: var(--gold); color: var(--gold); }
.qr { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; }
.qr img { display: block; width: 240px; height: 240px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }

#toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: #23232b; color: var(--text); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .2s; max-width: 92vw; z-index: 50; font-weight: 600; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: #6b2b2b; color: #ffb3b3; } #toast.ok { border-color: #1f5a41; color: #b6f3d6; }
@media (max-width: 420px) { .balance { font-size: 34px; } .grid3 { grid-template-columns: 1fr 1fr; } }

/* carteira do jogador */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px 14px; min-height: 0; }
.tile span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.tile b { font-size: 20px; font-variant-numeric: tabular-nums; }
.tile.on { border-color: var(--gold); } .tile.on span { color: var(--gold); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { min-height: 32px; padding: 4px 12px; border: 0; border-radius: 0; font-size: 13px; font-weight: 600; background: transparent; color: var(--muted); }
.seg button.on { background: var(--panel2); color: var(--gold); }

/* cobrança com cartão */
.charge-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 16px 18px; margin-bottom: 12px; min-height: 72px; }
.charge-cta b { font-size: 18px; } .charge-cta span { font-size: 12px; font-weight: 600; opacity: .8; }
.wait, .result { text-align: center; }
.wait h2 { margin-top: 6px; }
.nfc-pulse { width: 96px; height: 96px; margin: 18px auto 14px; border-radius: 50%; border: 2px solid var(--gold); position: relative; }
.nfc-pulse::before, .nfc-pulse::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--gold); animation: ring 1.8s ease-out infinite; }
.nfc-pulse::after { animation-delay: .9s; }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
.big-icon { width: 64px; height: 64px; margin: 4px auto 10px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 800; }
.result.ok .big-icon { background: rgba(62,207,142,.15); color: var(--green); border: 1px solid #1f5a41; }
.result.bad .big-icon { background: rgba(255,107,107,.12); color: var(--red); border: 1px solid #6b2b2b; }
.result .kv { text-align: left; }
.notice { animation: pop .35s ease-out; } .notice.deb { border-color: #5a4c1b; } .notice.cred { border-color: #1f5a41; }
@keyframes pop { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.openreq { border-color: var(--gold); margin-bottom: 12px; }
.nfc-dot { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold); position: relative; flex: none; }
.nfc-dot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--gold); animation: ring 1.8s ease-out infinite; }

/* comanda do bar e cozinha */
.tab { border-color: #4a3f17; }
.tab.due { border-color: #6b2b2b; box-shadow: 0 0 0 1px rgba(255,107,107,.15), 0 6px 22px rgba(0,0,0,.35); }
.tab-total { font-size: 22px; font-weight: 800; color: var(--gold2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.titems { margin-top: 10px; border-top: 1px dashed var(--line); }
.titem { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.titem:last-child { border-bottom: 0; }
.titem .sm { min-height: 30px; width: 30px; padding: 0; }
.due-banner { border-color: #6b2b2b; background: rgba(255,107,107,.08); color: #ffd0d0; }
.kv.tap { cursor: pointer; }
