/* ═══════════════════════════════════════════════════════════════════════
   Token Tycoon: clicker de IA em estilo cyberpunk (ardósia escura, ciano e roxo neon).
   A cor do projeto vem de --accent / --accent-2 (o <body> as recebe do catálogo, src/data/projects.js).
   As demais cores têm função fixa: --good (pode comprar), --bad (bug), --gold (post viral).
   Movimento: o JS põe data-motion="reduced" no <body> quando o sistema pede menos animação (ou pela opção do jogo).
   Áreas de toque de 44px ou mais. Não depende de tokens.css nem de Bootstrap.
   ═══════════════════════════════════════════════════════════════════════ */

/* ───────── Tokens ───────── */
:root {
	color-scheme: dark;
	--accent: #22d3ee;
	--accent-2: #a855f7;
	--bg: #070a14;
	--bg-2: #0d1226;
	--ink: #e8eefc;
	--ink-2: #b4bfdc;
	--ink-3: #8592b4;
	--line: rgb(255 255 255 / .1);
	--good: #34f5a2;
	--bad: #ff4d6d;
	--gold: #ffd166;
	--ease: cubic-bezier(.2, .8, .2, 1);
	--pop: cubic-bezier(.34, 1.56, .64, 1);
	--font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
	--radius: 20px;
	--energy: 0; /* 0 a 1: cresce com o Tk/s; o JS escreve */
	--tier: 0; /* 0 a 1: cresce com os Tokens da vida e puxa a cor do núcleo do ciano para o roxo */
	--heat: 0; /* 0 a 1: cliques rápidos esquentam o núcleo */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0;
	display: flex;
	flex-direction: column;
	overflow-x: hidden;
	background: var(--bg);
	color: var(--ink);
	font: 400 1rem/1.5 var(--font);
	-webkit-tap-highlight-color: transparent;
}
body[data-phase="boot"] { overflow: hidden; }
button { font: inherit; color: inherit; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.i { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.flip { transform: scaleX(-1); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ───────── Fundo: auroras, grade e linha de varredura ───────── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: radial-gradient(120% 80% at 50% -10%, #141b3a 0%, var(--bg) 60%); }
.bg i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(100px); opacity: calc(.16 + var(--energy) * .22); transition: opacity 1.2s ease; }
.bg i:nth-child(1) { left: -18vmax; top: -24vmax; background: var(--accent); animation: drift 26s ease-in-out infinite alternate; }
.bg i:nth-child(2) { right: -24vmax; bottom: -30vmax; background: var(--accent-2); animation: drift 32s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.12); } }
.grid { position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px); background-size: 46px 46px; -webkit-mask-image: radial-gradient(90% 70% at 50% 35%, #000 20%, transparent 100%); mask-image: radial-gradient(90% 70% at 50% 35%, #000 20%, transparent 100%); }
.scan { position: absolute; left: 0; right: 0; height: 22vh; top: -22vh; background: linear-gradient(transparent, color-mix(in srgb, var(--accent) 7%, transparent), transparent); animation: scan 9s linear infinite; }
@keyframes scan { to { transform: translateY(130vh); } }

/* ───────── Botões, pílulas e ferramentas ───────── */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 1px solid var(--line); border-radius: 14px; background: rgb(255 255 255 / .06); color: var(--ink); font-weight: 600; cursor: pointer; overflow: hidden; transition: transform .14s var(--pop), background .2s, border-color .2s, box-shadow .2s; }
.btn:hover { background: rgb(255 255 255 / .11); }
.btn:active { transform: scale(.96); }
.btn--primary { border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #05070f; box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn--primary:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 14px 36px -8px color-mix(in srgb, var(--accent) 85%, transparent); }
.btn--primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .55) 50%, transparent 65%); transform: translateX(-120%); }
.btn--primary:hover::after { transform: translateX(120%); transition: transform .7s var(--ease); }
.btn--big { min-height: 56px; padding: 0 30px; font-size: 1.1rem; }
.btn--ghost { background: transparent; }
.btn--danger { border-color: color-mix(in srgb, var(--bad) 50%, transparent); color: var(--bad); }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; max-width: 1180px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 12px 0; }
.top__tools { display: flex; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: rgb(255 255 255 / .06); color: var(--ink-2); font-size: .875rem; font-weight: 500; text-decoration: none; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .2s, color .2s, transform .14s var(--pop); }
.pill:hover { background: rgb(255 255 255 / .12); color: var(--ink); }
.pill:active { transform: scale(.96); }
.tool { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: rgb(255 255 255 / .06); color: var(--ink); cursor: pointer; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .2s, border-color .2s, box-shadow .2s, transform .14s var(--pop); }
.tool:hover { background: rgb(255 255 255 / .12); }
.tool:active { transform: scale(.88); }
.tool[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 18px -4px color-mix(in srgb, var(--accent) 70%, transparent); color: var(--accent); }
.tool[aria-pressed="false"] { color: var(--ink-3); }
.tool[aria-pressed="false"]::after { content: ''; position: absolute; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transform: rotate(-45deg); }
.tool__badge { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(1.35); } }

/* ───────── Letreiro de notícias ───────── */
.ticker { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 1180px; margin: 10px auto 0; padding: 0 12px; font-family: var(--mono); font-size: .8125rem; color: var(--ink-2); }
.ticker__tag { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; background: color-mix(in srgb, var(--bad) 22%, transparent); color: #ff9bb0; font-weight: 700; font-size: .6875rem; letter-spacing: .08em; }
.ticker__tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); animation: beat 1.2s ease-in-out infinite; }
.ticker__text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ticker__text.is-in { animation: ticker-in .6s var(--ease); }
@keyframes ticker-in { from { opacity: 0; transform: translateY(8px); } }

/* ───────── Estrutura ───────── */
.game { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 12px 12px 110px; display: grid; gap: 14px; align-content: start; }
.nojs { padding: 14px 18px; border-radius: 14px; background: rgb(255 255 255 / .08); text-align: center; }
.panel { position: relative; min-width: 0; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); background: linear-gradient(160deg, rgb(22 31 62 / .78), rgb(10 14 32 / .82)); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 24px 60px -28px rgb(0 0 0 / .9), inset 0 1px 0 rgb(255 255 255 / .06); }
.panel::before, .panel::after { content: ''; position: absolute; width: 16px; height: 16px; pointer-events: none; border: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); }
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: var(--radius) 0 0 0; }
.panel::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-radius: 0 0 var(--radius) 0; }

/* Mobile: uma seção por vez, escolhida pelo dock. Desktop: núcleo à esquerda, loja à direita. */
.core-panel { display: none; }
body[data-view="core"] .core-panel { display: grid; }
body:not([data-view="core"]) .store { display: flex; }
.store { display: none; }
.dock { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px 8px max(6px, env(safe-area-inset-bottom)); background: rgb(7 10 20 / .88); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.dock button { position: relative; display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 6px 4px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-3); font-size: .75rem; font-weight: 600; cursor: pointer; transition: color .2s, background .2s, transform .14s var(--pop); }
.dock button .i { width: 1.45em; height: 1.45em; transition: transform .25s var(--pop); }
.dock button:active { transform: scale(.92); }
.dock button[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.dock button[aria-current="page"] .i { transform: translateY(-2px) scale(1.08); }
.dock__badge, .tab__badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--good); color: #04110b; font: 700 .6875rem/18px var(--mono); text-align: center; }
.dock__badge { position: absolute; top: 2px; right: calc(50% - 26px); }
@media (min-width: 960px) {
	.game { grid-template-columns: minmax(380px, 5fr) minmax(440px, 6fr); align-items: start; padding-bottom: 28px; }
	.core-panel, body:not([data-view="core"]) .core-panel { display: grid; position: sticky; top: 12px; }
	.store, body:not([data-view="core"]) .store { display: flex; }
	.dock { display: none; }
}

/* ───────── Núcleo: contador, núcleo e Pitch ───────── */
.core-panel { gap: 6px; padding: 18px 14px 16px; justify-items: center; align-content: start; text-align: center; }
.hud { width: 100%; display: grid; justify-items: center; gap: 2px; }
.hud__label { margin: 0; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-family: var(--mono); font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.hud__count { margin: 0; font: 700 clamp(2.4rem, 11vw, 4.2rem)/1.05 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: #fff; text-shadow: 0 0 .5em color-mix(in srgb, var(--accent) 70%, transparent), 0 0 1.4em color-mix(in srgb, var(--accent) 35%, transparent); }
.hud__count.is-bump { animation: bump .32s var(--pop); }
.hud__count.is-lost { animation: lost .5s ease; }
@keyframes bump { 40% { transform: scale(1.09); } }
@keyframes lost { 0%, 100% { color: #fff; } 30% { color: var(--bad); transform: translateX(-3px); } 60% { transform: translateX(3px); } }
.hud__rate { margin: 0; font-family: var(--mono); font-size: .9375rem; color: var(--ink-2); }
.hud__rate b { display: inline-block; color: var(--accent); font-variant-numeric: tabular-nums; }
.hud__rate b.is-bump { animation: bump .35s var(--pop); }
.hud__click { color: var(--ink-3); }
.buffs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 0; margin-top: 8px; }
.buff { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 14%, rgb(10 14 30)); color: var(--gold); font: 700 .8125rem var(--mono); animation: buff-in .5s var(--pop); }
.buff__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--gold); transform-origin: left; }
@keyframes buff-in { from { transform: scale(.5); opacity: 0; } }

.stage { position: relative; display: grid; place-items: center; width: 100%; padding: 6px 0 2px; --pulse: 0; }
.stage__halo { position: absolute; width: min(96vw, 440px); aspect-ratio: 1; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) calc(24% + var(--heat) * 34%), transparent), transparent); opacity: calc(.55 + var(--heat) * .45); transform: scale(calc(.9 + var(--heat) * .22 + var(--energy) * .1)); transition: transform .25s ease-out; }
.core { position: relative; z-index: 1; width: min(68vw, 42dvh, 330px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; outline-offset: 10px; }
.core:focus-visible { outline: 3px solid var(--accent); }
.core__svg { display: block; width: 100%; height: 100%; overflow: visible; will-change: transform; }
.c-halo { fill: url(#tt-halo); }
.c-ring { fill: none; stroke: var(--accent); stroke-linecap: round; }
.c-link { fill: none; stroke: color-mix(in srgb, var(--accent) 60%, var(--accent-2)); stroke-width: 1; opacity: .35; }
.c-node { fill: color-mix(in srgb, var(--accent) 55%, white); opacity: .22; transition: opacity .6s ease, fill .3s; }
.c-node.is-lit { opacity: .95; }
.c-node.is-zap { animation: zap .5s ease-out; }
@keyframes zap { 0% { fill: #fff; opacity: 1; } 100% { } }
.c-orb { fill: url(#tt-orb); }
.c-rim { fill: none; stroke: rgb(255 255 255 / .55); stroke-width: 1.5; }
.c-wave { fill: none; stroke: rgb(255 255 255 / .7); stroke-width: 2; stroke-linecap: round; }
.c-ripple { fill: none; stroke: var(--accent); stroke-width: 3; transform-box: fill-box; transform-origin: center; }
.combo { position: absolute; z-index: 2; top: 4px; right: 4%; display: grid; justify-items: center; line-height: 1; pointer-events: none; font-family: var(--mono); color: var(--accent); text-shadow: 0 0 .7em color-mix(in srgb, var(--accent) 70%, transparent); transition: opacity .35s ease, transform .35s var(--pop); }
.combo b { font-size: clamp(1.5rem, 6vw, 2.2rem); font-weight: 700; }
.combo small { font-size: .6875rem; letter-spacing: .2em; text-transform: uppercase; }
.combo.is-hot { color: var(--gold); text-shadow: 0 0 .8em var(--gold); }
.combo.is-tick b { animation: bump .22s var(--pop); }
.combo.is-off { opacity: 0; transform: scale(.7) translateY(-8px); }
.stage__hint { position: relative; z-index: 1; margin: 6px 0 0; color: var(--ink-3); font-size: .875rem; transition: opacity .6s ease; }
.stage__hint.is-gone { opacity: 0; }

.deal { width: 100%; max-width: 420px; margin-top: 8px; }
.btn--pitch { width: 100%; min-height: 60px; justify-content: flex-start; gap: 14px; padding: 8px 18px; border-color: color-mix(in srgb, var(--gold) 50%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 20%, transparent), color-mix(in srgb, var(--accent-2) 22%, transparent)); text-align: left; }
.btn--pitch .i { width: 1.6em; height: 1.6em; color: var(--gold); }
.btn--pitch span { display: grid; line-height: 1.25; }
.btn--pitch small { color: var(--gold); font: 700 .875rem var(--mono); }
.btn--pitch.is-ready { animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 28px -2px color-mix(in srgb, var(--gold) 75%, transparent); border-color: var(--gold); } }

/* Compra rápida: só no celular, para não ter de trocar de aba a cada compra */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 128px)); justify-content: center; gap: 8px; width: 100%; max-width: 420px; margin-top: 10px; }
.quick__btn { display: grid; justify-items: center; gap: 2px; min-height: 76px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 14px; background: rgb(255 255 255 / .05); color: inherit; cursor: pointer; transition: transform .14s var(--pop), border-color .2s, background .2s; }
.quick__btn:active { transform: scale(.93); }
.quick__btn[data-afford="true"] { border-color: color-mix(in srgb, var(--good) 55%, transparent); background: color-mix(in srgb, var(--good) 12%, transparent); }
.quick__btn[aria-disabled="true"] { opacity: .7; }
.quick__icon { color: var(--accent); }
.quick__owned { font: 700 1.05rem/1 var(--mono); }
.quick__cost { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font: 700 .75rem var(--mono); }
.quick__btn[data-afford="true"] .quick__cost { color: var(--good); }
.quick__cost .i { width: .9em; height: .9em; }
@media (min-width: 960px) { .quick { display: none; } }

/* ───────── Loja ───────── */
.store { flex-direction: column; gap: 10px; padding: 12px; min-height: 0; }
@media (max-width: 959px) { .tabs:not(.tabs--menu) { display: none; } }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 5px; border-radius: 14px; background: rgb(0 0 0 / .28); border: 1px solid var(--line); }
.tab { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); font-weight: 600; font-size: .9375rem; cursor: pointer; transition: color .2s, background .2s, transform .14s var(--pop); }
.tab:hover { color: var(--ink); }
.tab:active { transform: scale(.95); }
.tab[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.pane { display: grid; gap: 10px; align-content: start; min-width: 0; animation: pane-in .35s var(--ease); }
@keyframes pane-in { from { opacity: 0; transform: translateY(10px); } }
@media (min-width: 960px) {
	.store { max-height: calc(100dvh - 24px); }
	.pane { overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 40%, transparent) transparent; }
}
.qty { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.qty button { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: rgb(255 255 255 / .04); color: var(--ink-2); font: 600 .875rem var(--mono); cursor: pointer; transition: all .15s var(--pop); }
.qty button:active { transform: scale(.93); }
.qty button[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.list { display: grid; gap: 8px; }

.item { position: relative; }
.item__buy { position: relative; width: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 68px; padding: 10px 14px 10px 10px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(120deg, rgb(255 255 255 / .05), rgb(255 255 255 / .02)); color: inherit; text-align: left; cursor: pointer; overflow: hidden; transition: transform .14s var(--pop), border-color .2s, box-shadow .2s, background .2s; }
.item__buy::before { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 38%, color-mix(in srgb, var(--accent) 22%, transparent) 50%, transparent 62%); transform: translateX(-120%); pointer-events: none; }
.item__buy:hover::before { transform: translateX(120%); transition: transform .8s var(--ease); }
.item__buy:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.item__buy:active { transform: scale(.975); }
.item__buy[aria-disabled="true"] { cursor: not-allowed; }
.item[data-afford="false"] .item__buy { opacity: .78; }
.item[data-afford="true"] .item__buy { border-color: color-mix(in srgb, var(--good) 45%, transparent); background: linear-gradient(120deg, color-mix(in srgb, var(--good) 11%, transparent), rgb(255 255 255 / .02)); }
.item__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 15%, rgb(8 12 26)); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.item__icon .i { width: 1.7em; height: 1.7em; }
.item__body { display: grid; gap: 1px; min-width: 0; }
.item__name { font-weight: 700; line-height: 1.25; }
.item__flavor { color: var(--ink-3); font-size: .8125rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item__stats { color: var(--ink-2); font: 500 .75rem var(--mono); }
.item__side { display: grid; justify-items: end; gap: 4px; }
.item__owned { min-width: 2ch; font: 700 1.5rem/1 var(--mono); color: color-mix(in srgb, var(--ink) 80%, var(--accent)); font-variant-numeric: tabular-nums; }
.item__owned.is-bump { animation: bump .3s var(--pop); }
.item__cost { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; background: rgb(0 0 0 / .32); color: var(--ink-3); font: 700 .8125rem var(--mono); }
.item__cost .i { width: 1em; height: 1em; }
.item[data-afford="true"] .item__cost { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.item.is-bought .item__buy { animation: bought .5s ease-out; }
@keyframes bought { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 80%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.item.is-deny .item__buy { animation: deny .32s ease; }
@keyframes deny { 25% { transform: translateX(-5px); } 55% { transform: translateX(5px); } 85% { transform: translateX(-2px); } }
.item--lock .item__buy { cursor: default; border-style: dashed; background: transparent; }
.item--lock .item__icon { color: var(--ink-3); background: rgb(255 255 255 / .04); box-shadow: none; }
.item--lock .item__name { filter: blur(5px); user-select: none; }
.item--lock .item__flavor { color: var(--ink-3); }

/* Esqueleto de carregamento */
.item--sk { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 10px; min-height: 68px; border: 1px solid var(--line); border-radius: 16px; }
.sk { border-radius: 12px; background: linear-gradient(100deg, rgb(255 255 255 / .05) 30%, rgb(255 255 255 / .13) 50%, rgb(255 255 255 / .05) 70%) 0 0 / 220% 100%; animation: sk 1.3s linear infinite; }
.sk--icon { width: 52px; height: 52px; }
.sk--lines { height: 36px; align-self: center; }
@keyframes sk { to { background-position: -220% 0; } }

/* Upgrades */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 8px; }
.cards > li { display: grid; }
.card { position: relative; display: grid; gap: 4px; align-content: start; width: 100%; min-height: 108px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(140deg, rgb(255 255 255 / .06), rgb(255 255 255 / .02)); color: inherit; text-align: left; cursor: pointer; overflow: hidden; transition: transform .14s var(--pop), border-color .2s; }
.card:hover { border-color: color-mix(in srgb, var(--accent-2) 60%, transparent); }
.card:active { transform: scale(.97); }
.card[aria-disabled="true"] { cursor: not-allowed; opacity: .78; }
.card.is-afford { border-color: color-mix(in srgb, var(--good) 45%, transparent); background: linear-gradient(140deg, color-mix(in srgb, var(--good) 11%, transparent), rgb(255 255 255 / .02)); opacity: 1; }
.card__name { font-weight: 700; line-height: 1.25; }
.card__effect { color: var(--accent); font-size: .8125rem; font-weight: 600; }
.card__flavor { color: var(--ink-3); font-size: .8125rem; line-height: 1.35; }
.card__cost { margin-top: auto; justify-self: start; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; background: rgb(0 0 0 / .32); color: var(--ink-3); font: 700 .8125rem var(--mono); }
.card.is-afford .card__cost { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.card.is-launch { animation: launch .45s var(--ease) forwards; pointer-events: none; }
@keyframes launch { 0% { transform: scale(1); } 30% { transform: scale(1.06); box-shadow: 0 0 30px color-mix(in srgb, var(--good) 70%, transparent); } 100% { transform: scale(.6) translateY(-30px); opacity: 0; } }
.card.is-new { animation: card-in .5s var(--pop); }
@keyframes card-in { from { transform: scale(.8); opacity: 0; } }
.card.is-deny { animation: deny .32s ease; }

/* Estados vazios */
.empty { display: grid; justify-items: center; gap: 6px; padding: 34px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; color: var(--ink-2); }
.empty p { margin: 0; max-width: 34ch; color: var(--ink-3); font-size: .9375rem; }
.empty__ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); animation: float 3s ease-in-out infinite; }
.empty__ico .i { width: 1.6em; height: 1.6em; }
@keyframes float { 50% { transform: translateY(-5px); } }

/* Funding */
.fund { display: grid; gap: 10px; padding: 14px; border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); border-radius: 16px; background: linear-gradient(140deg, color-mix(in srgb, var(--gold) 9%, transparent), color-mix(in srgb, var(--accent-2) 10%, transparent)); }
[data-lock], [data-open] { display: grid; gap: 10px; }
.fund__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.fund__big { font: 700 1.8rem/1 var(--mono); color: var(--gold); text-shadow: 0 0 .6em color-mix(in srgb, var(--gold) 45%, transparent); }
.fund__big.is-bump { animation: bump .4s var(--pop); }
.fund__label { color: var(--ink-2); font-size: .875rem; }
.fund__note { margin: 0; color: var(--ink-3); font-size: .8125rem; line-height: 1.4; }
.meter { height: 8px; border-radius: 4px; background: rgb(0 0 0 / .4); overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--gold)); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .5s var(--ease); }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: rgb(255 255 255 / .14); }
.pips i.is-on { background: var(--gold); box-shadow: 0 0 8px color-mix(in srgb, var(--gold) 70%, transparent); }
.item--perk .item__icon { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, rgb(8 12 26)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 28%, transparent); }
.item--perk[data-afford="true"] .item__cost { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.item--perk[data-afford="true"] .item__buy { border-color: color-mix(in srgb, var(--gold) 50%, transparent); background: linear-gradient(120deg, color-mix(in srgb, var(--gold) 11%, transparent), rgb(255 255 255 / .02)); }
.item--perk.is-max .item__buy { cursor: default; opacity: .8; }

/* ───────── Eventos: bug e post viral ───────── */
.fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.ev { position: fixed; z-index: 70; display: grid; place-items: center; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 50%; color: #fff; cursor: pointer; pointer-events: auto; touch-action: manipulation; animation: ev-in .55s var(--pop) backwards, ev-bob 2.6s ease-in-out .55s infinite; }
.ev .i { width: 2.1em; height: 2.1em; position: relative; z-index: 1; }
.ev__label { position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%); padding: 2px 8px; border-radius: 6px; background: rgb(0 0 0 / .7); font: 700 .6875rem var(--mono); letter-spacing: .06em; white-space: nowrap; }
.ev__ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); pointer-events: none; }
.ev__ring circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.ev__ring .bgc { stroke: rgb(255 255 255 / .18); }
.ev__ring .fg { stroke: currentColor; stroke-dasharray: 100; stroke-dashoffset: 0; animation: ring var(--life, 10s) linear forwards; }
@keyframes ring { to { stroke-dashoffset: 100; } }
@keyframes ev-in { from { transform: scale(0) rotate(-120deg); opacity: 0; } }
@keyframes ev-bob { 50% { transform: translateY(-7px) rotate(2deg); } }
.ev--viral { color: var(--gold); background: radial-gradient(circle at 35% 30%, #fff6cf, var(--gold) 45%, color-mix(in srgb, var(--accent-2) 70%, var(--gold)) 100%); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 35%, transparent), 0 0 40px 6px color-mix(in srgb, var(--gold) 60%, transparent); }
.ev--viral .i { color: #3b2a00; }
.ev--viral .ev__label { color: var(--gold); }
.ev--bug { color: var(--bad); background: radial-gradient(circle at 35% 30%, #ff9bb0, var(--bad) 50%, #7a0f2a 100%); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 35%, transparent), 0 0 40px 6px color-mix(in srgb, var(--bad) 60%, transparent); animation: ev-in .4s var(--pop) backwards, ev-shake .22s linear .4s infinite; }
.ev--bug .i { color: #2a0610; }
.ev--bug .ev__label { color: #ff9bb0; }
@keyframes ev-shake { 25% { transform: translate(3px, -2px) rotate(2deg); } 50% { transform: translate(-3px, 2px) rotate(-2deg); } 75% { transform: translate(2px, 3px); } }
.ev.is-gone { animation: ev-out .35s ease-in forwards; pointer-events: none; }
@keyframes ev-out { to { transform: scale(.2); opacity: 0; } }
.vignette { position: fixed; inset: 0; z-index: 55; pointer-events: none; opacity: 0; background: radial-gradient(closest-side, transparent 60%, color-mix(in srgb, var(--bad) 38%, transparent)); transition: opacity .4s ease; }
body.is-alert .vignette { opacity: 1; animation: alert 1s ease-in-out infinite; }
@keyframes alert { 50% { opacity: .45; } }
.flash { position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: 0; background: #fff; }

/* Números, tokens e faíscas que sobem */
.pop { position: absolute; z-index: 61; left: 0; top: 0; font: 700 1.35rem var(--mono); color: #fff; text-shadow: 0 0 .6em var(--accent), 0 2px 0 rgb(0 0 0 / .4); white-space: nowrap; will-change: transform, opacity; }
.pop--big { font-size: 1.9rem; color: var(--gold); text-shadow: 0 0 .7em var(--gold), 0 2px 0 rgb(0 0 0 / .4); }
.pop--bad { color: #ff9bb0; text-shadow: 0 0 .7em var(--bad), 0 2px 0 rgb(0 0 0 / .4); }
.chip { position: absolute; z-index: 61; left: 0; top: 0; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 22%, rgb(8 12 26)); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); color: color-mix(in srgb, var(--accent) 60%, white); font: 600 .75rem var(--mono); white-space: nowrap; will-change: transform, opacity; }
.spark { position: absolute; z-index: 61; left: 0; top: 0; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--accent)); box-shadow: 0 0 10px var(--c, var(--accent)); will-change: transform, opacity; }

/* ───────── Avisos (conquistas e recados) ───────── */
.toasts { position: fixed; z-index: 90; left: 12px; bottom: calc(env(safe-area-inset-bottom) + 84px); display: grid; gap: 8px; width: min(380px, calc(100vw - 24px)); pointer-events: none; }
@media (min-width: 960px) { .toasts { left: auto; right: 18px; bottom: 18px; } }
.toast { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); background: rgb(14 18 38 / .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 16px 40px -12px rgb(0 0 0 / .8), 0 0 30px -8px color-mix(in srgb, var(--gold) 50%, transparent); animation: toast-in .55s var(--pop) backwards; pointer-events: auto; }
.toast.is-out { animation: toast-out .4s ease-in forwards; }
.toast__ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.toast__ico .i { width: 1.5em; height: 1.5em; animation: shine 1.4s ease-in-out infinite; }
.toast strong { display: block; line-height: 1.25; }
.toast p { margin: 0; color: var(--ink-2); font-size: .8125rem; line-height: 1.35; }
.toast--info { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 16px 40px -12px rgb(0 0 0 / .8); }
.toast--info .toast__ico { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.toast--bad { border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.toast--bad .toast__ico { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
@media (max-width: 959px) {
	/* no celular o aviso é compacto, para não cobrir a compra rápida */
	.toast { grid-template-columns: 34px 1fr; gap: 10px; padding: 6px 10px 6px 8px; border-radius: 14px; }
	.toast__ico { width: 34px; height: 34px; border-radius: 10px; }
	.toast__ico .i { width: 1.2em; height: 1.2em; }
	.toast strong { font-size: .875rem; }
	.toast p { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.toast > div { min-width: 0; }
}
@keyframes toast-in { from { transform: translateX(-30px) scale(.9); opacity: 0; } }
@keyframes toast-out { to { transform: translateX(-30px); opacity: 0; } }
@keyframes shine { 50% { transform: scale(1.18) rotate(-6deg); } }

/* ───────── Tela de início ───────── */
.boot { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: radial-gradient(120% 90% at 50% 0%, #14204a 0%, var(--bg) 62%); transition: opacity .6s ease, visibility .6s; overflow: auto; }
.boot.is-gone { opacity: 0; visibility: hidden; }
.boot__card { display: grid; justify-items: center; gap: 12px; width: min(100%, 440px); text-align: center; }
.boot__mark { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; color: var(--accent); background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent); animation: spin 18s linear infinite; }
.boot__mark .i { width: 2.6em; height: 2.6em; stroke-width: 1.6; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot__title { margin: 0; font: 700 clamp(2.2rem, 9vw, 3.2rem)/1.05 var(--font); letter-spacing: -.02em; background: linear-gradient(120deg, #fff, var(--accent) 55%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot__sub { margin: 0; color: var(--ink-2); font-size: 1.0625rem; max-width: 34ch; }
.boot__log { display: grid; gap: 4px; width: 100%; margin: 6px 0 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgb(0 0 0 / .35); font: 500 .8125rem var(--mono); color: var(--ink-2); text-align: left; }
.boot__log li { display: flex; justify-content: space-between; gap: 12px; opacity: 0; animation: log-in .35s ease forwards; }
.boot__log li::before { content: '> '; color: var(--accent); }
.boot__log li:nth-child(1) { animation-delay: .25s; } .boot__log li:nth-child(2) { animation-delay: .6s; } .boot__log li:nth-child(3) { animation-delay: .95s; } .boot__log li:nth-child(4) { animation-delay: 1.3s; }
.boot__log b { margin-left: auto; color: var(--good); }
@keyframes log-in { from { transform: translateX(-8px); } to { opacity: 1; } }
.boot__back { margin: 0; padding: 10px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); background: color-mix(in srgb, var(--gold) 10%, transparent); color: var(--gold); font-size: .9375rem; }
.boot__card .btn { margin-top: 6px; animation: glow-btn 2.2s ease-in-out 1.6s infinite; }
@keyframes glow-btn { 50% { box-shadow: 0 0 40px -4px color-mix(in srgb, var(--accent) 80%, transparent); } }
.boot__note { margin: 0; color: var(--ink-3); font-size: .8125rem; }
.boot__nojs { margin: 0; color: var(--bad); }

/* ───────── Diálogos ───────── */
.dlg { width: min(94vw, 460px); max-height: 90dvh; padding: 0; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 22px; background: linear-gradient(160deg, #141c3a, #0a0e20); color: var(--ink); box-shadow: 0 40px 100px -20px rgb(0 0 0 / .9), 0 0 60px -20px color-mix(in srgb, var(--accent) 60%, transparent); overflow: hidden; }
.dlg--wide { width: min(94vw, 620px); }
.dlg[open] { animation: dlg-in .35s var(--pop); }
.dlg::backdrop { background: rgb(3 5 12 / .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes dlg-in { from { transform: translateY(24px) scale(.94); opacity: 0; } }
.dlg__box { display: grid; gap: 14px; margin: 0; padding: 20px; max-height: 90dvh; overflow-y: auto; }
.dlg__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dlg__head h2 { margin: 0; font-size: 1.35rem; }
.dlg__foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.pitch__quote { margin: 0; padding: 12px 14px; border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); border-radius: 0 12px 12px 0; color: var(--ink-2); font-style: italic; }
.pitch__gain { display: grid; justify-items: center; gap: 2px; padding: 14px; border-radius: 16px; background: rgb(0 0 0 / .3); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.pitch__gain span { color: var(--ink-3); font-size: .875rem; }
.pitch__gain b { font: 700 2.6rem/1 var(--mono); color: var(--gold); text-shadow: 0 0 .6em color-mix(in srgb, var(--gold) 50%, transparent); }
.pitch__gain small { color: var(--ink-2); font-size: .875rem; }
.pitch__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pitch__cols h3 { margin: 0 0 4px; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.pitch__cols li { color: var(--ink-2); font-size: .875rem; line-height: 1.5; }
.pitch__cols li::before { content: '· '; color: var(--accent); }
.pitch__tip { margin: 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--ink-2); font-size: .875rem; }
.mpane { display: grid; gap: 10px; }
.mpane__lead { margin: 0; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; margin: 0; }
.stats dt { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.stats dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); font: 700 .9375rem var(--mono); text-align: right; }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; }
.ach li { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgb(255 255 255 / .03); }
.ach li .ach__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: rgb(255 255 255 / .05); color: var(--ink-3); }
.ach li.is-on { border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.ach li.is-on .ach__ico { color: var(--gold); background: color-mix(in srgb, var(--gold) 15%, transparent); }
.ach strong { display: block; font-size: .9375rem; line-height: 1.25; }
.ach small { color: var(--ink-3); font-size: .8125rem; line-height: 1.3; }
.ach li:not(.is-on) strong { filter: blur(4px); user-select: none; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 52px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgb(255 255 255 / .03); }
.opt__text { display: grid; gap: 0; }
.opt__text small { color: var(--ink-3); font-size: .8125rem; line-height: 1.3; }
.switch { position: relative; flex: none; width: 52px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 15px; background: rgb(255 255 255 / .1); cursor: pointer; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--pop); }
.switch[aria-checked="true"] { background: color-mix(in srgb, var(--accent) 70%, transparent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.opt input[type="range"] { width: 140px; accent-color: var(--accent); }
.opt textarea { width: 100%; min-height: 80px; margin-top: 8px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: rgb(0 0 0 / .35); color: var(--ink); font: 400 .75rem var(--mono); resize: vertical; }
.opt--stack { display: grid; }
.opt__btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* ───────── Rodapé ───────── */
.foot { display: grid; gap: 4px; justify-items: center; padding: 4px 16px 96px; color: var(--ink-3); font-size: .8125rem; text-align: center; }
.foot p { margin: 0; }
.foot a { text-underline-offset: 3px; }
.foot kbd { padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); background: rgb(255 255 255 / .06); font: 500 .75rem var(--mono); }
@media (min-width: 960px) { .foot { padding-bottom: 24px; } }
@media (hover: none) { .foot__keys { display: none; } }

/* ───────── Momentos de impacto: Pitch, bug que passou, dica na aba ───────── */
body.is-pitching .stage__halo { transform: scale(1.5); opacity: 1; transition: transform .7s ease-in, opacity .7s; }
body.is-pitching .hud__count { animation: pitch-count .25s ease-in-out infinite; }
@keyframes pitch-count { 50% { transform: scale(1.07); } }
body.is-glitch .game { animation: glitch .42s steps(2, end); }
@keyframes glitch { 0% { filter: hue-rotate(0); transform: translateX(0); } 20% { filter: hue-rotate(90deg) saturate(2); transform: translateX(-5px); } 40% { filter: hue-rotate(-60deg); transform: translateX(6px) skewX(3deg); } 60% { filter: hue-rotate(160deg); transform: translateX(-3px); } 100% { filter: none; transform: none; } }
.dock button.is-nudge { color: var(--good); animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-5px); background: color-mix(in srgb, var(--good) 16%, transparent); } }
.buff__bar { transition: transform .25s linear; }
.buff__label { position: relative; }

/* ───────── Menos movimento ───────── */
body[data-motion="reduced"] *, body[data-motion="reduced"] *::before, body[data-motion="reduced"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
body[data-motion="reduced"] .scan { display: none; }
