:root {
  --ink: #16111d; --bg: #0b0814; --panel: #221a33; --panel-hi: #34284c; --panel-lo: #150f22;
  --text: #f3e9d2; --muted: #a596bd; --gold: #ffd54a; --gold-d: #b9800f;
  --purple: #8a45c4; --purple-d: #4a2270; --blue: #3f78c2; --blue-d: #264b80; --red: #c4453a; --red-d: #7a2420;
  --up: #6ee88a; --down: #ff6b5a; --s: 2;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at 50% 0%, #2a1747 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text); font: 22px/1.15 'Jersey 15', monospace;
  display: grid; justify-content: center; align-content: center; padding: 16px; gap: 12px;
  grid-template-columns: auto 360px; grid-template-areas: 'top top' 'game side' 'bottom side' 'links links' 'dev dev';
}
.top    { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
#wrap   { grid-area: game; position: relative; }
.side   { grid-area: side; height: 0; min-height: 100%; overflow-y: auto; }   /* acompanha a altura do jogo + barra, rola por dentro */
.links  { grid-area: links; display: flex; gap: 12px; flex-wrap: wrap; }
.links .panel { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.ca { flex: 1 1 420px; min-width: 0; }
.ca > b { font: 10px 'Press Start 2P'; color: var(--ink); background: var(--gold); padding: 5px 6px 4px; box-shadow: 0 0 0 2px var(--ink), inset 0 -2px 0 var(--gold-d); flex: none; }
.ca code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px 'Press Start 2P'; color: var(--gold); background: var(--ink); padding: 9px 10px; }
.socials { flex: 0 1 auto; }
.socials > small { font-size: 18px; margin-right: 2px; }
.social { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font: 10px 'Press Start 2P'; background: var(--panel-lo); padding: 8px 12px 7px; box-shadow: inset 0 0 0 2px var(--ink), inset 0 -3px 0 var(--panel-hi); }
.social:hover { background: var(--panel-hi); color: var(--gold); }
.social svg { width: 16px; height: 16px; fill: currentColor; }
.social.off { opacity: .4; pointer-events: none; }
.bottom { grid-area: bottom; display: flex; gap: 10px; flex-wrap: wrap; }
.dev    { grid-area: dev; padding: 10px 14px 14px; }
.dev header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.dev header b { font: 11px 'Press Start 2P'; color: var(--down); }
.devrow { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; }
.grp > small { display: block; font-size: 16px; margin-bottom: 6px; }
.dev .row { justify-content: flex-start; }
.dev select { font: 18px 'Jersey 15'; color: var(--text); background: var(--panel-lo); border: 0; padding: 6px 8px; box-shadow: inset 0 0 0 2px var(--ink); }
h2 { font: 14px 'Press Start 2P'; color: var(--gold); margin: 0 0 14px; line-height: 1.4; }
h3 { font: 11px 'Press Start 2P'; color: var(--gold); margin: 14px 0 8px; }
h3 small { color: var(--muted); font: 18px 'Jersey 15'; }
small { color: var(--muted); }

canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges;
         box-shadow: 0 0 0 4px var(--ink), 0 0 0 7px var(--panel-hi), 0 0 0 10px var(--ink), 0 18px 40px #000a; }
.panel { background: var(--panel); box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 6px var(--panel-hi), 0 4px 0 var(--ink); padding: 12px 14px; }
.card  { background: var(--panel-lo); box-shadow: inset 0 0 0 2px var(--ink); padding: 10px; }

.logo { display: flex; align-items: center; gap: 12px; }
.logo img { width: 33px; image-rendering: pixelated; filter: drop-shadow(0 3px 0 var(--ink)); animation: bob 2.4s ease-in-out infinite; }
.logo h1 { margin: 0; font: 26px 'Press Start 2P', monospace; letter-spacing: 1px; color: #fbf3dc;
  text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink), 0 3px 0 #8a5530, 0 6px 0 var(--ink); }
.logo h1 span { color: var(--gold); text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink), 0 3px 0 var(--gold-d), 0 6px 0 var(--ink); }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-6deg); } }

.wallet { display: flex; align-items: center; gap: 12px; }
.wallet img { width: 28px; image-rendering: pixelated; }
.wallet b { display: block; font: 15px 'Press Start 2P'; color: var(--gold); }
#wallet::after { content: ' $DIG'; font-size: 9px; color: var(--muted); }
#oracle { font-size: 18px; color: var(--muted); border-left: 3px solid var(--panel-hi); padding-left: 12px; }
#oracle .live { display: inline-block; width: 8px; height: 8px; margin-right: 6px; background: var(--up); box-shadow: 0 0 0 2px var(--ink); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
#oracle b { display: block; font: 12px 'Press Start 2P'; margin-top: 4px; }
.up { color: var(--up); } .down { color: var(--down); }
.pop { animation: pop .35s steps(4); }
@keyframes pop { 40% { transform: scale(1.25); color: #fff; } }

.seg { display: flex; box-shadow: 0 0 0 3px var(--ink); }
.seg button, .tabs button { flex: 1; border: 0; padding: 8px 10px; font: 19px 'Jersey 15'; color: var(--muted); background: var(--panel-lo); cursor: pointer; }
.seg button.on, .tabs button.on { background: var(--gold); color: var(--ink); box-shadow: inset 0 -3px 0 var(--gold-d); }
.tabs { display: flex; box-shadow: 0 0 0 3px var(--ink); margin-bottom: 12px; position: sticky; top: 0; z-index: 2; }

.btn { border: 0; cursor: pointer; font: 20px 'Jersey 15'; color: #fff; padding: 10px 16px 13px; position: relative;
       display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 120px;
       box-shadow: inset 0 0 0 3px var(--ink), inset 0 -6px 0 0 var(--d), inset 0 6px 0 0 #ffffff33, 0 4px 0 var(--ink); background: var(--c); }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 3px var(--ink), inset 0 -3px 0 0 var(--d), 0 1px 0 var(--ink); }
.btn:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
.btn small { font: 10px 'Press Start 2P'; opacity: .85; color: inherit; }
.btn img { width: 28px; image-rendering: pixelated; margin-bottom: 2px; }
.btn.mini { min-width: 0; padding: 6px 10px 9px; font-size: 18px; box-shadow: inset 0 0 0 2px var(--ink), inset 0 -4px 0 0 var(--d), 0 3px 0 var(--ink); }
.btn.wide { width: 100%; }
.gold { --c: var(--gold); --d: var(--gold-d); color: var(--ink); }
.purple { --c: var(--purple); --d: var(--purple-d); }
.blue { --c: var(--blue); --d: var(--blue-d); }
.red { --c: var(--red); --d: var(--red-d); }
.ghost { --c: var(--panel-lo); --d: var(--ink); color: var(--muted); }

/* claim no baú de cada mina */
.chestClaim { position: absolute; transform: translate(-50%, 0); pointer-events: auto; border: 0; cursor: pointer; z-index: 2;
  font: max(9px, calc(var(--s) * 3.4px)) 'Press Start 2P'; line-height: 1; color: var(--ink); background: var(--gold); padding: 4px 7px 6px;
  box-shadow: inset 0 -3px 0 var(--gold-d), 0 0 0 2px var(--ink), 0 0 14px #ffd54a99; }
.chestClaim:hover { filter: brightness(1.12); }
.chestClaim:active { transform: translate(-50%, 2px); }

/* inventário */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px; }
.item { position: relative; border: 0; background: var(--panel-lo); padding: 6px 2px 4px; text-align: center; color: var(--text); font: 15px 'Jersey 15';
        box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--rc); cursor: default; }
.item img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; display: block; margin: 0 auto 2px; }
.item span { display: block; color: var(--muted); font-size: 14px; }
.item.free span { color: var(--up); }
.pickable .item { cursor: pointer; }
.pickable .item:hover { filter: brightness(1.2); }
.pickable .item.sel { background: #3a2c55; box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--rc), 0 0 0 3px var(--gold); }
.pickable .item.none img { opacity: .4; }


/* referral */
.reflink { display: flex; gap: 6px; margin: 8px 0 12px; }
.reflink code { flex: 1; background: var(--ink); padding: 8px; font: 12px 'Press Start 2P'; color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.stats div { background: var(--panel-lo); box-shadow: inset 0 0 0 2px var(--ink); padding: 8px; }
.stats b { display: block; font: 12px 'Press Start 2P'; color: var(--gold); margin-top: 4px; }
.note { font-size: 18px; color: var(--muted); }


.result { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); text-align: center; min-width: 260px; z-index: 3;
          --rc: var(--gold); box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 6px var(--rc), 0 4px 0 var(--ink), 0 0 32px var(--rc); animation: rise .3s steps(4); }
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }
#resRarity { font: 14px 'Press Start 2P'; text-shadow: 0 3px 0 var(--ink); }
#resName { font-size: 27px; margin: 6px 0 2px; }
#resMult { color: var(--muted); margin-bottom: 10px; }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.row .btn { min-width: 0; padding: 8px 14px 11px; }
#toast { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--gold); padding: 8px 14px; font: 11px 'Press Start 2P'; z-index: 4; box-shadow: 0 0 0 2px var(--gold-d); }

.overlay { position: fixed; inset: 0; background: #07040ecc; display: grid; place-items: center; z-index: 10; padding: 16px; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; }
.modal.small { width: min(460px, 100%); }
.modal .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modal .preview { background: var(--panel-lo); box-shadow: inset 0 0 0 2px var(--ink); padding: 10px; margin: 14px 0; }
.modal .preview b { color: var(--up); }
table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
td, th { padding: 6px 8px; text-align: left; border-bottom: 2px solid var(--panel-hi); }
th { font: 10px 'Press Start 2P'; color: var(--muted); }
.onboard { width: min(440px, 100%); text-align: center; }
.onboard p { color: var(--muted); margin: 0 0 16px; }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.steps i { width: 24px; height: 6px; background: var(--panel-hi); box-shadow: 0 0 0 2px var(--ink); }
.steps i.on { background: var(--gold); }
.quote { background: var(--panel-lo); box-shadow: inset 0 0 0 2px var(--ink); padding: 10px; margin-bottom: 10px; text-align: left; }
.quote span { display: block; color: var(--muted); font-size: 18px; }
.quote b { display: block; font: 14px 'Press Start 2P'; color: var(--gold); margin: 6px 0; }
.quote.ref b { font-size: 11px; color: var(--up); }
.kit { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.kit div { background: var(--panel-lo); box-shadow: inset 0 0 0 2px var(--ink); padding: 8px 4px; font-size: 16px; animation: rise2 .4s steps(4) backwards; }
.kit img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; display: block; margin: 0 auto 4px; }
@keyframes rise2 { from { transform: translateY(12px) scale(.6); opacity: 0; } }
[hidden] { display: none !important; }
body.busy .bottom button { pointer-events: none; opacity: .5; }

@media (max-width: 1000px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'top' 'game' 'bottom' 'side' 'links' 'dev'; align-content: start; justify-content: stretch; padding: 12px; }
  #wrap { justify-self: center; }
  .bottom { width: auto !important; }
  .top .seg { width: 100%; }
  .wallet { flex-wrap: wrap; width: 100%; }
  .side { max-height: none; }
  .logo h1 { font-size: 18px; }
  .btn { min-width: 0; flex: 1; }
  .modal .cols { grid-template-columns: 1fr; }
}

/* modo online: carteira, saldo pendente e painel de teste reduzido (só faucet, com validador local) */
.wallets { display: grid; gap: 8px; }
.wallets .btn { flex-direction: row; gap: 10px; text-decoration: none; }
.wallets .btn img { width: 24px; height: 24px; margin: 0; image-rendering: auto; }
#obGet, #obWithdraw { margin-top: 8px; }
.money { display: flex; gap: 6px; }
.money:not(:has(button:not([hidden]))) { display: none; }
.amt { display: flex; gap: 8px; margin: 8px 0 6px; }
.amt input { flex: 1; min-width: 0; font: 14px 'Press Start 2P'; color: var(--gold); background: var(--ink); border: 0; padding: 10px; box-shadow: inset 0 0 0 2px var(--panel-hi); }
.amt input:focus { outline: 2px solid var(--gold-d); outline-offset: 0; }
#moneyNote, #moneyMsg { margin: 0 0 12px; }
#moneyMsg { margin: 12px 0 0; }
#obMsg { margin: 14px 0 0; }
.addr { border: 0; cursor: pointer; font: 18px 'Jersey 15'; color: var(--muted); background: var(--panel-lo); padding: 4px 8px; box-shadow: inset 0 0 0 2px var(--ink); }
.addr:hover { color: var(--text); }
[data-online] { display: none; }
body.online [data-online] { display: inline; }
body.online [data-offline] { display: none !important; }
body.online:not(.local) .dev, body.online #clock { display: none; }

/* demo (?demo): sem painel de teste; selo no topo com o tempo acelerado */
body.demo .dev { display: none; }
.demoTag { display: none; flex-direction: column; align-items: center; gap: 3px; padding: 5px 8px 4px; background: var(--purple-d); box-shadow: inset 0 0 0 2px var(--ink), inset 0 -3px 0 var(--purple); }
body.demo .demoTag { display: flex; }
.demoTag b { font: 9px 'Press Start 2P'; color: var(--gold); }
.demoTag small { font-size: 15px; line-height: 1; color: var(--text); white-space: nowrap; }

/* barras de rolagem em pixel art (página, painel lateral e modais) */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: var(--panel-lo); box-shadow: inset 0 0 0 2px var(--ink); }
::-webkit-scrollbar-thumb { background: var(--gold); box-shadow: inset 0 0 0 2px var(--ink), inset -3px -3px 0 2px var(--gold-d), inset 3px 3px 0 2px #fff6cf66; }
::-webkit-scrollbar-thumb:hover { background: #ffe27a; }
::-webkit-scrollbar-corner { background: var(--ink); }
.side::-webkit-scrollbar { width: 10px; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-color: var(--gold) var(--panel-lo); } }
.social[aria-label="X"] { padding-inline: 10px; }

/* responsivo: tablet e celular */
.ca .btn, .socials .btn { flex: none; }
.links, .links > .panel { min-width: 0; max-width: 100%; }
@media (max-width: 1000px) {
  .links { flex-direction: column; }
  .ca, .socials { flex: none; width: 100%; }
  .side { height: auto; min-height: 0; max-height: none; overflow: visible; }
  .bottom { display: grid; grid-template-columns: 1fr 1fr; }
  .bottom .summary { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { padding: 8px; gap: 10px; font-size: 20px; }
  .top { gap: 8px; }
  .logo h1 { font-size: 15px; }
  .wallet { gap: 8px; padding: 10px; }
  .wallet b { font-size: 12px; }
  #oracle { padding-left: 8px; }
  .money { width: 100%; }
  .money .btn { flex: 1; }
  .ca { flex-wrap: wrap; }
  .ca code { flex: 1 1 100%; order: 3; font-size: 9px; }
  .ca .btn { flex: 1; }
  .socials { justify-content: space-between; }
  .modal { padding: 16px; }
  .tabs button { padding: 8px 4px; font-size: 17px; }
}

/* referral: o que os convidados geraram fica a coletar */
.collect { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px; background: var(--panel-lo); box-shadow: inset 0 0 0 2px var(--ink); }
.collect > div { flex: 1; min-width: 0; }
.collect b { display: block; font: 13px 'Press Start 2P'; color: var(--muted); margin-top: 6px; }
.collect b span { font-size: 8px; }
.collect.ready { box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--gold-d), 0 0 18px #ffd54a33; }
.collect.ready b { color: var(--gold); }
.collect .btn { min-width: 110px; }
.tabs button { position: relative; }
.tabs button.dot::after { content: ''; position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; background: var(--gold); box-shadow: 0 0 0 2px var(--ink); animation: blink 1s steps(2) infinite; }
.tabs button.on.dot::after { background: var(--ink); box-shadow: none; }

/* música: nota em pixel art; riscada quando desligada */
.musicBtn { width: 34px; height: 34px; border: 0; cursor: pointer; padding: 7px; margin-left: 6px; color: var(--gold); background: var(--panel-lo);
  box-shadow: inset 0 0 0 2px var(--ink), inset 0 -3px 0 var(--panel-hi); align-self: center; }
.musicBtn svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.musicBtn .x { display: none; fill: var(--down); }
.musicBtn.off { color: var(--muted); }
.musicBtn.off .x { display: inline; }
.musicBtn:hover { background: var(--panel-hi); }

/* ── HUD em pixel art (js/hud.js) ── */
/* minas: banner de rocha da camada com entrada escorada, placa de latão, molduras de pedra e trilho com carrinho */
.mine { position: relative; margin-top: 10px; background: #120d19; box-shadow: inset 0 0 0 2px var(--ink); }
.banner { position: relative; height: 66px; overflow: hidden; }
.banner .bg { display: block; height: 66px; width: auto; max-width: none; image-rendering: pixelated; }
.banner .name { position: absolute; left: 66px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; font: 12px 'Press Start 2P'; color: var(--oc);
  text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink); white-space: nowrap; }
.banner .name img { image-rendering: pixelated; filter: drop-shadow(0 2px 0 var(--ink)); }
.plaque { position: absolute; right: 6px; top: 6px; filter: drop-shadow(0 3px 0 #0b0710aa); }
.plaque img { display: block; image-rendering: pixelated; }
.plaque span { position: absolute; left: 18px; width: 54px; top: 9px; height: 15px; display: grid; place-items: center;
  font: 9px 'Press Start 2P'; color: #ffe9a8; text-shadow: 0 -1px 0 #2a1a04; letter-spacing: 1px; }
.hint { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; align-items: center; font: 8px 'Press Start 2P'; color: var(--muted);
  background: #0d0913cc; padding: 6px 7px 5px; box-shadow: 0 0 0 2px var(--ink); }
.hint img { image-rendering: pixelated; }
.mine.locked .name { color: #8d84a0; }
.mine .body { padding: 8px 9px 9px; }
.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; justify-items: center; }
.slot { border: 0; padding: 0; background: none; cursor: pointer; width: 100%; max-width: 66px; transition: transform .08s steps(2); }
.slot img { display: block; width: 100%; image-rendering: pixelated; }
.slot:hover { transform: translateY(-2px); }
.slot.glow-epico { filter: drop-shadow(0 0 4px #d873ffaa); }
.slot.glow-lendario { filter: drop-shadow(0 0 5px #ffd54acc); animation: shine 1.6s steps(4) infinite; }
@keyframes shine { 50% { filter: drop-shadow(0 0 8px #ffd54a); } }
.track { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.track img { display: block; image-rendering: pixelated; }
.track .time { margin-left: auto; font: 9px 'Press Start 2P'; color: var(--muted); min-width: 52px; text-align: right; }
.mine.done .time { color: var(--gold); animation: blink 1s steps(2) infinite; }
.refinery { margin-top: 14px; display: flex; gap: 10px; align-items: center; background: #120d19; padding: 8px 10px; box-shadow: inset 0 0 0 2px var(--ink); }
.refinery .furnace { width: 52px; image-rendering: pixelated; }
.refinery b { font: 11px 'Press Start 2P'; }
.refinery small { color: var(--muted); font-size: 18px; }
.refinery .sol { margin-left: auto; border: 0; cursor: pointer; padding: 7px 10px 9px; font: 9px 'Press Start 2P'; color: var(--ink); white-space: nowrap;
  background: var(--gold); box-shadow: inset 0 0 0 2px var(--ink), inset 0 -4px 0 var(--gold-d), 0 3px 0 var(--ink); }
.refinery .sol:hover { filter: brightness(1.1); }
.refinery .sol:active { transform: translateY(2px); }
.refinery .maxed { margin-left: auto; font: 9px 'Press Start 2P'; color: var(--gold); }

/* boxes: caixotes reforçados com raios de luz e brilhos; preço numa plaquinha com a moeda */
.boxwrap { position: relative; display: flex; flex: 1 1 180px; min-width: 0; }
.crate { position: relative; flex: 1; display: flex; align-items: center; gap: 10px; border: 0; cursor: pointer; overflow: hidden; padding: 8px 12px 8px 8px; color: var(--text); text-align: left;
  background: radial-gradient(circle at 44px 50%, var(--glow) 0%, transparent 70%), #120d19; box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--rim), 0 4px 0 var(--ink); }
.crate .art { position: relative; z-index: 1; flex: none; width: 68px; image-rendering: pixelated; animation: bob 2.4s steps(6) infinite; }
.crate:hover .art { animation: hop .5s steps(3) infinite alternate; }
.crate:active { transform: translateY(2px); }
@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes hop { to { transform: translateY(-6px) rotate(-2deg); } }
.crate .ray { position: absolute; left: 42px; top: 50%; width: 230px; height: 230px; transform: translate(-50%, -50%); pointer-events: none;
  background: repeating-conic-gradient(from 0deg, var(--rim) 0deg 8deg, transparent 8deg 30deg); opacity: .13; animation: spin 18s linear infinite; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.crate .spark { position: absolute; z-index: 1; width: 5px; height: 5px; background: #fff; box-shadow: 0 0 0 2px var(--rim); opacity: 0; animation: twinkle 1.8s steps(3) infinite; }
.crate .spark:nth-of-type(1) { left: 10px; top: 12px; }
.crate .spark:nth-of-type(2) { left: 70px; top: 18px; animation-delay: .6s; }
.crate .spark:nth-of-type(3) { left: 16px; bottom: 12px; animation-delay: 1.1s; }
@keyframes twinkle { 30% { opacity: 1; } 60% { opacity: 0; } }
.crate .txt { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
.crate b { font: 11px 'Press Start 2P'; text-shadow: 0 2px 0 var(--ink); }
.crate .price { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 4px; background: #0d0913; box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 2px var(--rim);
  font: 9px 'Press Start 2P'; color: var(--gold); white-space: nowrap; }
.crate .price small { color: var(--muted); font: 8px 'Press Start 2P'; }
.crate .price .coin { width: 14px; image-rendering: pixelated; }
.info { position: absolute; top: 6px; right: 6px; z-index: 2; border: 0; padding: 0; background: none; cursor: pointer; width: 18px; height: 18px; }
.info img { display: block; width: 18px; image-rendering: pixelated; }
.info:hover { filter: brightness(1.2); transform: scale(1.1); }

/* resumo: três quadros com ícone */
.summary { flex: 1 1 300px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; }
.summary > div { display: flex; align-items: center; gap: 8px; background: #120d19; padding: 6px 8px; box-shadow: inset 0 0 0 2px var(--ink); min-width: 0; }
.summary img { flex: none; width: 24px; image-rendering: pixelated; }
.summary small { display: block; color: var(--muted); font-size: 17px; }
.summary b { display: block; font: 10px 'Press Start 2P'; color: var(--up); margin-top: 5px; white-space: nowrap; }
@media (max-width: 560px) {
  .summary { grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 6px; }
  .summary > div { flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px; }
  .summary img { width: 20px; }
  .summary b { font-size: 9px; }
  .crate { flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; text-align: center; }
  .crate .txt { align-items: center; }
  .crate b { font-size: 10px; }
  .crate .ray { left: 50%; top: 36%; }
  .banner .name { font-size: 11px; }
}

/* tela de lançamento */
.wall { background: #07040eee; z-index: 20; }
.wallbox { width: min(480px, 100%); text-align: center; padding: 22px 20px; }
.wallbox .crate-art { width: 84px; image-rendering: pixelated; animation: bob 2.4s steps(6) infinite; }
.wallbox h1 { font: 26px 'Press Start 2P'; color: var(--gold); margin: 8px 0 6px; text-shadow: 0 3px 0 var(--ink); }
.wallbox .tag { color: var(--muted); margin: 0 0 14px; font-size: 20px; }
.wallbox .lbl { font: 9px 'Press Start 2P'; color: var(--muted); letter-spacing: 1px; }
.wallbox .count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.wallbox .count div { background: #120d19; box-shadow: inset 0 0 0 2px var(--ink); padding: 10px 4px 8px; }
.wallbox .count b { display: block; font: 22px 'Press Start 2P'; color: var(--text); }
.wallbox .count small { font: 8px 'Press Start 2P'; color: var(--muted); }
.wallbox .when { font-size: 17px; color: var(--muted); margin: 0 0 16px; }
.wallbox .invite { background: var(--panel-lo); box-shadow: inset 0 0 0 2px var(--ink); padding: 14px 12px 10px; margin-bottom: 14px; }
.wallbox h2 { font: 12px 'Press Start 2P'; margin: 0 0 12px; }
.wallbox .perks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wallbox .perks div { background: #120d19; box-shadow: inset 0 0 0 2px var(--ink); padding: 10px 8px; }
.wallbox .perks b { display: block; font: 20px 'Press Start 2P'; color: var(--up); margin-bottom: 6px; }
.wallbox .perks small { font-size: 16px; color: var(--muted); line-height: 1; }
.wallbox .stats { margin-top: 10px; }
.wallbox .stats b { color: var(--gold); }
.wallbox .wallets { display: grid; gap: 8px; margin-top: 8px; }
.wallbox .row { display: flex; gap: 8px; justify-content: center; }
.wallbox .row .btn { --c: #3a2f52; --d: #241c35; color: var(--text); text-decoration: none; }
.wallbox .note.err { color: #ff7a7a; }
.wallbox .by b { color: var(--gold); }
.wallbox .demo { --c: #3a2f52; --d: #241c35; }
.wallbox .follow { margin-top: 4px; }
.wallbox .follow .btn { flex-direction: row; gap: 8px; }
.wallbox .follow svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.wallbox .follow .btn.off { display: none; }
@media (max-width: 420px) {
  .wallbox h1 { font-size: 20px; }
  .wallbox .count b { font-size: 16px; }
  .wallbox .perks b { font-size: 16px; }
  .wallbox .reflink code { font-size: 10px; }
}
.wallbox .reflink { flex-wrap: wrap; }
.wallbox .reflink code { flex: 1 1 100%; text-align: center; }
.wallbox .reflink .btn { flex: 1; }

/* textos que não cabem: quebram dentro do quadro em vez de vazar */
.refinery > div { flex: 1; min-width: 0; }
.refinery .sol { flex: none; white-space: normal; text-align: center; line-height: 1.6; }
.summary span { min-width: 0; }
.summary b { white-space: normal; overflow-wrap: normal; line-height: 1.4; font-size: clamp(8px, .72vw, 11px); }
.summary small { line-height: 1.1; }

/* quests diárias: botão ao lado do saldo com "!" quando tem giro pronto */
.questBtn { position: relative; border: 0; padding: 4px; cursor: pointer; background: #120d19; box-shadow: inset 0 0 0 2px var(--ink); line-height: 0; }
.questBtn img { width: 30px; image-rendering: pixelated; }
.questBtn:hover { filter: brightness(1.15); }
.questBtn i { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; display: grid; place-items: center; font: 10px 'Press Start 2P'; font-style: normal; color: #fff;
  background: #e0312b; box-shadow: 0 0 0 2px var(--ink); animation: bang 1s steps(2) infinite; }
@keyframes bang { 50% { transform: translateY(-2px) scale(1.1); } }
.questbox { width: min(520px, 100%); }
.questbox .qhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.questbox h2 { font: 14px 'Press Start 2P'; margin: 0; color: var(--gold); }
.questbox > .note { margin: 6px 0 12px; }
.quest { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; background: #120d19; box-shadow: inset 0 0 0 2px var(--ink); padding: 8px 10px; margin-bottom: 8px; }
.quest.is-ready { box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--gold-d); }
.quest.is-spun { opacity: .7; }
.quest .qicon { width: 44px; height: 44px; display: grid; place-items: center; background: #0d0913; box-shadow: inset 0 0 0 2px var(--ink); color: var(--text); }
.quest .qicon img { max-width: 34px; max-height: 34px; image-rendering: pixelated; }
.quest .qicon svg { width: 22px; height: 22px; }
.quest .qtxt { min-width: 0; }
.quest .qtxt b { display: block; font: 10px 'Press Start 2P'; margin-bottom: 4px; }
.quest .qtxt small { display: block; color: var(--muted); font-size: 16px; line-height: 1.05; }
.quest .qdone { font: 9px 'Press Start 2P'; color: var(--up); white-space: nowrap; }
.quest .spin { animation: bang 1s steps(2) infinite; }
.quest .qpost { grid-column: 1 / -1; display: grid; gap: 8px; padding-top: 4px; }
.quest .qpost a { text-decoration: none; justify-self: start; }
.quest .qrow { display: flex; gap: 6px; }
.quest .qrow input { flex: 1; min-width: 0; background: var(--ink); border: 0; color: var(--text); font: 18px 'Jersey 15'; padding: 6px 8px; box-shadow: inset 0 0 0 2px #3a2f52; }
.quest .qrow input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--gold-d); }
.quest .qverify .bar { height: 10px; background: var(--ink); box-shadow: inset 0 0 0 2px #3a2f52; }
.quest .qverify .bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--gold) 0 6px, var(--gold-d) 6px 8px); }
.quest .qverify small { display: block; margin-top: 4px; color: var(--muted); font: 8px 'Press Start 2P'; }
.quest .qerr { margin: 0; color: #ff7a7a; font-size: 17px; }
.questbox .qfoot { display: grid; gap: 8px; margin-top: 4px; }
.questbox .qfoot > small { font: 9px 'Press Start 2P'; color: var(--muted); }
.qodds { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.qodds span { display: inline-flex; align-items: center; gap: 5px; font-size: 16px; color: var(--muted); }
.qodds i { width: 10px; height: 10px; background: var(--c); box-shadow: 0 0 0 2px var(--ink); }
.wheelov { z-index: 25; background: #07040ef0; }
.wheelbox { width: min(360px, 100%); text-align: center; }
.wheelbox h2 { font: 12px 'Press Start 2P'; margin: 0 0 8px; color: var(--gold); }
#wheelCanvas { display: block; width: min(300px, 78vw); height: min(300px, 78vw); margin: 0 auto; background: none; box-shadow: none; border: 0; image-rendering: auto; }
.wheelbox .prize { min-height: 52px; margin: 8px 0 10px; display: grid; place-items: center; }
.wheelbox .prize b { font: 16px 'Press Start 2P'; color: var(--gold); text-shadow: 0 3px 0 var(--ink); }
.wheelbox .prize small { color: var(--muted); font-size: 17px; }
.wheelbox .prize.win { animation: prizePop .5s steps(4); }
.wheelbox .prize.s0 b { color: #8fbfff; } .wheelbox .prize.s1 b { color: #6ee88a; } .wheelbox .prize.s3 b { color: #d873ff; }
@keyframes prizePop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } }
@media (max-width: 420px) {
  .quest { grid-template-columns: 36px 1fr; }
  .quest .qicon { width: 36px; height: 36px; }
  .quest .qright { grid-column: 1 / -1; justify-self: end; }
}
.questbox .ghost { --c: #3a2f52; --d: #241c35; color: var(--text); }
