:root {
  --bg: #08110e; --felt: #0f3d2b; --panel: #13241e; --panel2: #1b332a; --panel3: #244638;
  --line: rgba(255, 255, 255, .09); --line2: rgba(255, 255, 255, .16);
  --text: #f4f7f5; --muted: #9db5aa; --gold: #ffc233; --gold2: #ffd75a; --gold-d: #a86a00;
  --green: #46d98a; --red: #ff6b5b; --blue: #4aa8ff;
  --display: "Baloo 2", "Nunito", "Segoe UI", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --spring: cubic-bezier(.2, .9, .3, 1.25);
  font-family: var(--body);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent; }
#c { display: block; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); cursor: crosshair;
  touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { -webkit-user-drag: none; user-select: none; }
.hidden { display: none !important; }
.ico { width: 1.25em; height: 1.25em; vertical-align: -0.28em; object-fit: contain; }
.ico.lg { width: 1.7em; height: 1.7em; vertical-align: -0.5em; }
h1, h2, h3, .btn, .nav button, .purse b, .bet, .stat b, .tag, .rar { font-family: var(--display); }

/* ---------- fundo: feltro com vinheta ---------- */
.app, .auth, .splash {
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(47, 191, 122, .28), transparent 62%),
    radial-gradient(900px 600px at 100% 110%, rgba(255, 194, 51, .08), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #0c1c16, #060d0a 85%);
}

/* ---------- casca do lobby ---------- */
.app { position: fixed; inset: 0; z-index: 5; display: grid; grid-template-rows: auto auto 1fr; grid-template-columns: 1fr; }
.hud { display: flex; align-items: center; gap: 14px; padding: 10px 18px; }
.profile { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border-radius: 999px; border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)); min-width: 0; transition: transform .12s, border-color .15s; }
.profile:hover { border-color: var(--gold); }
.profile:active { transform: scale(.97); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: #0b1a14; border: 2px solid var(--gold); padding: 2px; flex: none; }
.who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.who b { font-family: var(--display); font-size: 17px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.who small.ok { color: var(--green); }
.who small.warn { color: #ffcf6b; }

.wallet { display: flex; gap: 22px; margin-left: auto; }
.purse { position: relative; display: flex; align-items: center; height: 36px; padding: 0 14px 0 30px; border-radius: 999px;
  background: linear-gradient(180deg, #0a1612, #10221b); border: 1px solid var(--line2); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .55); }
.purse > img { position: absolute; left: -14px; top: 50%; width: 40px; height: 40px; transform: translateY(-50%); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
.purse b { font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.purse .add { margin: 0 -8px 0 10px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: linear-gradient(180deg, #5fe89f, #1f9d63);
  color: #04301c; font: 800 18px/1 var(--display); display: grid; place-items: center; box-shadow: 0 2px 0 #0d5c38; }
.purse .add:active { transform: translateY(2px); box-shadow: none; }
.purse.bump > img { animation: coin-pop .5s var(--spring); }
.purse.bump b { animation: num-pop .5s var(--spring); }
.delta { position: absolute; right: 8px; top: 100%; font: 800 15px var(--display); pointer-events: none; animation: delta-float 1.3s ease-out forwards; white-space: nowrap; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }
@keyframes coin-pop { 30% { transform: translateY(-50%) scale(1.35) rotate(-12deg); } }
@keyframes num-pop { 30% { transform: scale(1.18); color: var(--gold2); } }
@keyframes delta-float { 0% { opacity: 0; transform: translateY(-6px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(22px); } }

.nav { display: flex; gap: 8px; padding: 4px 18px 10px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav button { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 16px 7px 10px; border-radius: 14px;
  border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 16px; font-weight: 700; transition: background .15s, color .15s, transform .12s; }
.nav button img { width: 30px; height: 30px; transition: transform .25s var(--spring); filter: saturate(.75) brightness(.9); }
.nav button:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.nav button:hover img { transform: translateY(-2px) scale(1.08); }
.nav button:active { transform: scale(.96); }
.nav button.on { color: #fff; background: linear-gradient(180deg, rgba(255, 194, 51, .22), rgba(255, 194, 51, .06)); border-color: rgba(255, 194, 51, .5); }
.nav button.on img { filter: none; transform: scale(1.14); }
.nav button.on::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--gold);
  box-shadow: 0 0 10px var(--gold); animation: grow-x .3s var(--spring); }
@keyframes grow-x { from { transform: scaleX(0); } }

.view { overflow-y: auto; padding: 8px max(18px, calc((100% - 1180px) / 2)) 28px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--panel3) transparent; }
h2 { margin: 0 0 2px; font-size: 26px; line-height: 1.15; }
h3 { font-size: 18px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* entrada dos blocos ao trocar de aba */
.view.enter > *, .view.enter .card, .view.enter .stat { animation: rise .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 38ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.97); } }

/* ---------- botões ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: 14px;
  border: 1px solid var(--line2); background: linear-gradient(180deg, #2b4c3e, #1c352b); font-size: 16px; font-weight: 700; line-height: 1.2;
  box-shadow: 0 4px 0 #0a1712, inset 0 1px 0 rgba(255, 255, 255, .14); transition: transform .08s, box-shadow .08s, filter .15s; overflow: hidden; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #0a1712, inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }
.btn.primary { background: linear-gradient(180deg, var(--gold2), #f5a800); border-color: #ffe9a3; color: #3a2400;
  box-shadow: 0 4px 0 var(--gold-d), inset 0 1px 0 rgba(255, 255, 255, .6); text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--gold-d), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn.primary:not(:disabled)::before { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 65% { left: -60%; } 100% { left: 130%; } }
.btn.danger { background: linear-gradient(180deg, #d9483b, #a12a20); border-color: #ff9c90; color: #fff; box-shadow: 0 4px 0 #5e140d, inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.danger:active:not(:disabled) { box-shadow: 0 1px 0 #5e140d; }
.btn.small { padding: 6px 12px; font-size: 14px; border-radius: 11px; box-shadow: 0 3px 0 #0a1712, inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn.big { padding: 12px 20px; font-size: 20px; }
.btn.block { width: 100%; }
.link { padding: 0; border: 0; background: none; color: var(--gold2); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- banners ---------- */
.banner { display: flex; align-items: center; gap: 14px; padding: 10px 16px 10px 12px; margin-bottom: 14px; border-radius: 18px;
  background: linear-gradient(90deg, rgba(255, 194, 51, .22), rgba(255, 194, 51, .04)); border: 1px solid rgba(255, 194, 51, .5); }
.banner > img { width: 52px; height: 52px; flex: none; animation: wiggle 2.4s ease-in-out infinite; }
.banner.rescue { background: linear-gradient(90deg, rgba(255, 107, 91, .22), rgba(255, 107, 91, .04)); border-color: rgba(255, 107, 91, .5); }
.banner .grow { flex: 1; min-width: 0; }
.banner b { color: var(--gold2); font-family: var(--display); font-size: 18px; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-10deg) scale(1.08); } 84% { transform: rotate(9deg) scale(1.08); } 92% { transform: rotate(-5deg); } }

.equipped { display: flex; align-items: center; gap: 14px; padding: 8px 14px; margin-bottom: 18px; border-radius: 18px;
  background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); }
.equipped canvas { width: 240px; height: 40px; flex: none; }
.equipped .grow b { font-family: var(--display); font-size: 18px; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.card { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 20px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px; position: relative; box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
  transition: transform .2s var(--spring), border-color .2s, box-shadow .2s; }
.card:hover { transform: translateY(-5px); border-color: rgba(255, 194, 51, .45); box-shadow: 0 16px 34px rgba(0, 0, 0, .5); }
.card.locked { filter: saturate(.55) brightness(.8); }
.card .thumb { border-radius: 14px; overflow: hidden; position: relative; }
.card .thumb canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; transition: transform .35s ease; }
.card:hover .thumb canvas { transform: scale(1.06); }
.card .thumb .tag { position: absolute; top: 8px; right: 8px; background: rgba(4, 10, 8, .78); backdrop-filter: blur(4px); }
.card h3 { margin: 0; font-size: 19px; line-height: 1.2; }
.card .meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; }
.card .meta b { color: var(--text); }
.card .rule { display: inline-block; align-self: flex-start; margin: -2px 0 6px; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; color: #9fb3c8; background: rgba(255,255,255,.05); border: 1px solid var(--line2); cursor: help; }
.card .rule.r-called { color: #7dffbf; } .card .rule.r-bank8 { color: #ffd54a; } .card .rule.r-pro { color: #ffb36b; } .card .rule.r-bankAll { color: #ff8a7a; }
.rule-desc { color: #7dffbf; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel2); border: 1px solid var(--line2); }
.tag.d0 { color: #7dffbf; } .tag.d1 { color: #ffd54a; } .tag.d2 { color: #ff8a7a; }
.bet { font-size: 22px; font-weight: 800; color: var(--gold2); }

/* vitrine de taco */
.cue-stage { position: relative; border-radius: 14px; overflow: hidden; --rc: #9fb3c8;
  background: radial-gradient(120% 90% at 70% 15%, color-mix(in srgb, var(--rc) 34%, transparent), transparent 62%), linear-gradient(160deg, #1c2f28, #0a1410); }
.cue-stage canvas { display: block; width: 100%; height: auto; aspect-ratio: 12 / 5; transition: transform .35s var(--spring); }
.card:hover .cue-stage canvas { transform: scale(1.07) rotate(-1.5deg); }
.cue-stage .rar { position: absolute; left: 10px; top: 8px; padding: 1px 10px; border-radius: 999px; background: rgba(4, 10, 8, .7); color: var(--rc); border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent); }
.card.r-legendary { border-color: rgba(255, 176, 46, .5); animation: legend-glow 2.6s ease-in-out infinite; }
@keyframes legend-glow { 50% { box-shadow: 0 8px 26px rgba(0, 0, 0, .35), 0 0 22px rgba(255, 176, 46, .35); } }
.card.equipped-cue { border-color: var(--green); }
.bars { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.bar { display: grid; grid-template-columns: 18px 44px 1fr 38px; gap: 6px; align-items: center; }
.bar img { width: 18px; height: 18px; }
.bar i { display: block; height: 8px; border-radius: 5px; background: rgba(0, 0, 0, .4); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
.bar i::after { content: ""; display: block; height: 100%; width: var(--v); border-radius: 5px; background: linear-gradient(90deg, #46d98a, #ffd75a 70%, #ff6b5b); transform-origin: left; animation: fill-x .7s ease-out both; }
@keyframes fill-x { from { transform: scaleX(0); } }
.bar span:last-child { text-align: right; color: var(--text); font-weight: 700; }
.rar { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.price { font-weight: 800; }

.seg { display: inline-flex; background: rgba(0, 0, 0, .35); border: 1px solid var(--line2); border-radius: 14px; padding: 3px; gap: 2px; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; transition: background .15s, color .15s; }
.seg button.on { background: linear-gradient(180deg, var(--gold2), #f5a800); color: #3a2400; box-shadow: 0 2px 0 var(--gold-d); }

/* ---------- estatísticas ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { display: flex; align-items: center; gap: 10px; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.stat > img { width: 34px; height: 34px; flex: none; }
.stat small { color: var(--muted); display: block; font-size: 12px; }
.stat b { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); } .neg { color: var(--red); }
.strip { display: flex; gap: 4px; margin: 6px 0 18px; flex-wrap: wrap; }
.strip i { width: 14px; height: 26px; border-radius: 5px; background: var(--green); animation: rise .35s var(--spring) both; animation-delay: calc(var(--i, 0) * 18ms); }
.strip i.l { background: var(--red); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(255, 255, 255, .04); }
.panel { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 18px; overflow-x: auto; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: 14px; }

/* ---------- configurações ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .t { font-weight: 800; }
.set-row .d { color: var(--muted); font-size: 13px; margin-top: 2px; }
.switch { position: relative; width: 54px; height: 30px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #0a1511; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .6); border: 1px solid var(--line2); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(180deg, #fff, #cfd8d3); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); transition: transform .25s var(--spring); }
.switch input:checked + span { background: linear-gradient(180deg, #2fbf7a, #1f9d63); }
.switch input:checked + span::after { transform: translateX(24px); }
input[type=range] { width: 180px; accent-color: var(--gold); }
input[type=text], input[type=email], input[type=password] { background: #08120e; color: var(--text); border: 1px solid var(--line2); border-radius: 12px; padding: 9px 12px; font: inherit; min-width: 0; outline: none; }
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus { border-color: var(--gold); }
code.id { background: #08120e; border: 1px solid var(--line2); border-radius: 8px; padding: 6px 10px; font-size: 13px; word-break: break-all; }
.account-card { display: flex; align-items: center; gap: 14px; padding: 6px 4px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.account-card > img { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--gold); padding: 3px; background: #0b1a14; }
.account-card .grow { flex: 1; min-width: 140px; }
.account-card b { font-family: var(--display); font-size: 20px; display: block; }
.credits { color: var(--muted); font-size: 12px; margin-top: 14px; }
.credits a { color: var(--muted); }

/* ---------- modais ---------- */
#modal-root { position: fixed; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(2, 6, 4, .74); backdrop-filter: blur(3px); }
#modal-root.on { display: flex; animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: 100%; overflow: auto; background: linear-gradient(180deg, #1d3a2f, #10211b); border: 1px solid rgba(255, 194, 51, .55);
  border-radius: 24px; padding: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .1); animation: modal-in .38s var(--spring); }
@keyframes modal-in { from { opacity: 0; transform: translateY(26px) scale(.9); } }
.modal.wide { width: min(720px, 100%); }
.modal h2 { margin-bottom: 10px; }
.modal canvas[data-table-big] { display: block; width: 100%; border-radius: 14px; }
.modal .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 18px; padding-bottom: 4px; }
.result { text-align: center; }
.emblem { position: relative; width: 112px; height: 112px; margin: 0 auto 2px; display: grid; place-items: center; }
.emblem img { width: 92px; height: 92px; position: relative; animation: emblem-in .7s var(--spring) both; }
.emblem.win::before { content: ""; position: absolute; inset: -34px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 215, 90, .34) 0 12deg, transparent 12deg 24deg); -webkit-mask: radial-gradient(circle, #000 30%, transparent 68%); mask: radial-gradient(circle, #000 30%, transparent 68%);
  animation: spin 9s linear infinite; }
.emblem.loss img { filter: grayscale(1) brightness(.7); animation: emblem-drop .6s ease-out both; }
@keyframes emblem-in { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: none; } }
@keyframes emblem-drop { 0% { transform: translateY(-30px); opacity: 0; } 60% { transform: translateY(4px) rotate(6deg); opacity: 1; } 100% { transform: rotate(10deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
.result h2 { font-size: 38px; margin: 0 0 4px; letter-spacing: .02em; }
.result .win { color: var(--gold2); text-shadow: 0 3px 0 var(--gold-d), 0 0 26px rgba(255, 194, 51, .5); }
.result .loss { color: #c9d4cf; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin: 14px 0; text-align: left; }
.kv span { animation: rise .4s var(--spring) both; animation-delay: calc(var(--i, 0) * 45ms + 150ms); }
.kv span:nth-child(odd) { color: var(--muted); }
.kv span:nth-child(even) { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 35; pointer-events: none; }

#toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; background: rgba(8, 18, 14, .96); border: 1px solid var(--line2); font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: toast-in .35s var(--spring); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.toast.ok { border-color: rgba(70, 217, 138, .6); } .toast.ok::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.toast.err { border-color: rgba(255, 107, 91, .7); } .toast.err::before { background: var(--red); box-shadow: 0 0 8px var(--red); }
.toast.out { animation: toast-out .3s ease-in forwards; }
@keyframes toast-in { from { transform: translateY(18px) scale(.94); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(10px); opacity: 0; } }

/* ---------- abertura ---------- */
.splash { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; transition: opacity .35s; }
.splash.out { opacity: 0; pointer-events: none; }
.splash img { border-radius: 24px; box-shadow: 0 14px 40px rgba(0, 0, 0, .6); animation: logo-pulse 1.4s ease-in-out infinite; }
.splash p { margin: 0; }
.loadbar { width: 160px; height: 8px; border-radius: 6px; background: rgba(0, 0, 0, .5); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .7); }
.loadbar i { display: block; height: 100%; width: 40%; border-radius: 6px; background: linear-gradient(90deg, var(--gold), var(--gold2)); animation: load 1.1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-110%); } 100% { transform: translateX(280%); } }
@keyframes logo-pulse { 50% { transform: scale(1.06) rotate(-2deg); } }

/* ---------- login e cadastro ---------- */
.auth { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.auth-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.auth-bg .b { position: absolute; display: grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%; font: 800 calc(var(--s) * .3) var(--display); font-style: normal; color: #111;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .85), transparent 30%), radial-gradient(circle at 50% 50%, #f6f3e8 0 27%, transparent 28%), var(--c);
  box-shadow: inset -8px -10px 20px rgba(0, 0, 0, .45), 0 18px 30px rgba(0, 0, 0, .45); opacity: .55; animation: drift var(--d) ease-in-out infinite alternate; }
.b1 { --s: 120px; --c: #f5c518; --d: 9s; left: 6%; top: 12%; }
.b2 { --s: 76px; --c: #d62828; --d: 11s; left: 18%; bottom: 10%; }
.b3 { --s: 150px; --c: #161618; --d: 13s; right: 7%; top: 16%; }
.b4 { --s: 64px; --c: #f07814; --d: 8s; right: 20%; bottom: 14%; }
.b5 { --s: 54px; --c: #1c52c4; --d: 10s; left: 38%; top: 6%; }
.b6 { --s: 90px; --c: #801e24; --d: 12s; right: 36%; bottom: 4%; }
@keyframes drift { from { transform: translate(0, 0) rotate(0); } to { transform: translate(26px, -34px) rotate(40deg); } }
.auth-card { position: relative; width: min(400px, 100%); padding: 22px 24px 18px; border-radius: 26px; text-align: center;
  background: linear-gradient(180deg, rgba(29, 58, 47, .94), rgba(13, 28, 22, .96)); border: 1px solid rgba(255, 194, 51, .45);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .12); backdrop-filter: blur(8px); animation: modal-in .5s var(--spring); }
.auth-card.swap { animation: card-swap .35s var(--spring); }
@keyframes card-swap { 0% { transform: rotateY(70deg) scale(.96); opacity: .3; } }
.auth-card.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.auth-logo { margin-top: -62px; border-radius: 22px; box-shadow: 0 12px 30px rgba(0, 0, 0, .55); animation: logo-pulse 3s ease-in-out infinite; }
.auth-card h1 { margin: 6px 0 0; font-size: 32px; line-height: 1.1; letter-spacing: .02em; }
.auth-tag { margin: 2px 0 14px; color: var(--muted); font-size: 14px; }
#auth-form { display: grid; gap: 10px; }
.field { display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 48px; border-radius: 14px; background: #08120e; border: 1px solid var(--line2);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5); transition: border-color .15s, box-shadow .15s; }
.field:focus-within { border-color: var(--gold); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5), 0 0 0 3px rgba(255, 194, 51, .18); }
.field > img { width: 24px; height: 24px; flex: none; }
.field input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 16px; }
.field .peek { border: 0; background: none; padding: 4px; opacity: .55; display: grid; }
.field .peek.on { opacity: 1; }
.field .peek img { width: 22px; height: 22px; }
.auth-error { min-height: 18px; margin: 0; color: var(--red); font-size: 13px; font-weight: 700; }
.auth-switch { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line2); }
.auth-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

#rotate { display: none; position: fixed; inset: 0; z-index: 60; align-items: center; justify-content: center; flex-direction: column; gap: 12px;
  padding: 24px; background: var(--bg); color: var(--text); text-align: center; font: 700 18px var(--body); }
#rotate span { font-size: 44px; animation: spin 2.4s ease-in-out infinite; }
@media (orientation: portrait) and (pointer: coarse) { body.playing #rotate { display: flex; } }

/* ---------- telas estreitas (celular em pé) ---------- */
@media (max-width: 640px) {
  .hud { padding: 8px 10px; gap: 8px; }
  .who small { display: none; }
  .who b { max-width: 84px; font-size: 15px; }
  .avatar { width: 36px; height: 36px; }
  .wallet { gap: 18px; }
  .purse { height: 32px; padding: 0 10px 0 24px; }
  .purse > img { width: 34px; height: 34px; left: -12px; }
  .purse b { font-size: 16px; }
  .nav { padding: 2px 10px 8px; gap: 4px; }
  .nav button { flex-direction: column; gap: 0; padding: 5px 9px; font-size: 12px; flex: 1 0 auto; }
  .view { padding: 6px 12px 22px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
  .equipped canvas { width: 130px; }
  input[type=range] { width: 120px; }
  h2 { font-size: 22px; }
}

/* ---------- celular deitado: navegação vira trilho lateral ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .app { grid-template-rows: auto 1fr; grid-template-columns: auto 1fr; }
  .hud { grid-column: 1 / -1; padding: 6px 14px; }
  .nav { flex-direction: column; padding: 2px 6px 8px 10px; overflow-y: auto; overflow-x: hidden; gap: 2px; }
  .nav button { flex-direction: column; gap: 0; padding: 4px 8px; font-size: 11px; }
  .nav button img { width: 26px; height: 26px; }
  .nav button.on::after { left: -1px; right: auto; top: 20%; bottom: 20%; width: 3px; height: auto; }
  .view { padding: 4px 14px 16px 8px; }
  .avatar { width: 34px; height: 34px; }
  .auth-card { padding: 14px 20px 12px; width: min(560px, 100%); }
  .auth-logo { display: none; }
  .auth-card h1 { font-size: 24px; margin: 0; }
  .auth-tag { margin-bottom: 8px; }
  #auth-form { grid-template-columns: 1fr 1fr; }
  #auth-form .auth-error, #auth-form .btn { grid-column: 1 / -1; }
  .field { height: 42px; }
  .auth-or { margin: 8px 0; }
  .auth-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
