/* Voo Livre: a tela inteira é o 3D (canvas #view); o resto é HTML por cima.
   Direção visual: PLACAS DE AEROPORTO. Preto de asfalto, amarelo de linha de táxi, branco de faixa de pista, vermelho de aviso. Cantos de placa, filete
   interno, sem desfoque e sem degradê: blocos chapados e sombra dura. Tipografia: Overpass (nascida das placas de estrada) e Overpass Mono nos instrumentos.
   O menu segue o tema claro por padrão (escuro só pelo botão nas opções); os instrumentos de voo são SEMPRE placas escuras, para ler sobre qualquer céu. */

@font-face { font-family: 'Overpass'; src: url('/vendor/voo-livre/overpass.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Overpass Mono'; src: url('/vendor/voo-livre/overpass-mono.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
	--ink: #14171c;
	--ink-2: #444b56;
	--paper: #f6f3ea;
	--paper-2: #ebe6d8;
	--line: #14171c;
	--yellow: #ffc20e;
	--yellow-deep: #e2a800;
	--red: #c8302a;
	--blue: #1f5fa8;
	--green: #1c8a4e;
	--hud: #14171c;
	--hud-ink: #f6f3ea;
	--focus: #1f5fa8;
	--shadow: 5px 5px 0 var(--ink);
	--radius: 10px;
	--font: 'Overpass', 'Arial Narrow', system-ui, sans-serif;
	--mono: 'Overpass Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
	color-scheme: light;
}
[data-theme='dark'] {
	--ink: #f2efe6;
	--ink-2: #b9bfc8;
	--paper: #1a1e25;
	--paper-2: #242a33;
	--line: #f2efe6;
	--red: #ef5a52;
	--focus: #7fb4ff;
	--shadow: 5px 5px 0 #000;
	color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #14171c; overscroll-behavior: none; }
body { font: 500 1rem/1.5 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--yellow); color: #14171c; padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }
.i { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i--sm { width: 1em; height: 1em; }
kbd { font: 700 .8em var(--mono); background: var(--paper-2); color: var(--ink); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 6px; padding: 0 .45em; }

/* ───── cena ───── */
.view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: #14171c; outline: none; touch-action: none; }
body[data-screen='play'] .view { cursor: none; }
.vignette { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .8s ease; background: radial-gradient(ellipse at center, transparent 52%, rgba(10, 14, 20, .55) 100%); }
body.is-fast .vignette { opacity: 1; }

/* ───── contador de FPS (canto superior esquerdo) ───── */
.fps { position: fixed; top: 12px; left: 12px; z-index: 30; font: 700 .8125rem/1 var(--mono); letter-spacing: .02em; background: var(--hud); color: var(--yellow); border: 2px solid #000; border-radius: 6px; padding: 7px 9px; min-width: 4.8rem; text-align: center; pointer-events: none; }
.fps.is-low { color: #fff; background: var(--red); }

/* ───── carregando ───── */
.boot { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #14171c; color: #f6f3ea; padding: 24px; text-align: center; }
.boot__sign { display: flex; align-items: center; gap: 14px; background: var(--yellow); color: #14171c; border: 3px solid #14171c; outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 12px; padding: 12px 22px; }
.boot__sign h1 { margin: 0; font: 800 clamp(2rem, 6vw, 3.2rem)/1 var(--font); letter-spacing: -.01em; text-transform: uppercase; }
.boot__sign h1 b { font-weight: 300; margin-left: .15em; }
.boot__arrow .i { width: 2.4rem; height: 2.4rem; stroke-width: 2.2; transform: rotate(45deg); }
.boot__text { margin: 0; font: 600 1rem var(--mono); }
.boot__bar { width: min(420px, 80vw); height: 14px; border: 2px solid #f6f3ea; border-radius: 4px; overflow: hidden; }
.boot__bar i { display: block; width: 0; height: 100%; background: repeating-linear-gradient(90deg, var(--yellow) 0 16px, #14171c 16px 22px); transition: width .25s ease; }
.boot__error { max-width: 34rem; margin: 0; background: var(--red); color: #fff; border-radius: 8px; padding: 14px 16px; font-weight: 600; }

/* ───── ferramentas do canto superior direito ───── */
.tools { position: fixed; top: 12px; right: 12px; z-index: 30; display: flex; gap: 8px; }
body[data-screen='boot'] .tools { display: none; }
.tool { width: 44px; height: 44px; display: grid; place-items: center; background: var(--hud); color: var(--hud-ink); border: 2px solid #000; border-radius: 8px; padding: 0; }
.tool:hover { background: #262b33; }
.tool:active { transform: translateY(1px); }
.tool[aria-pressed='true'] { background: var(--yellow); color: #14171c; }
#muteBtn .i--off { display: none; }
#muteBtn[aria-pressed='true'] .i--off { display: block; }
#muteBtn[aria-pressed='true'] .i--on { display: none; }
#muteBtn[aria-pressed='true'] { background: var(--red); color: #fff; }
.tool--plain { background: transparent; color: var(--ink); border-color: transparent; width: 40px; height: 40px; }
.tool--plain:hover { background: var(--paper-2); }

/* ───── botões ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 46px; padding: .55em 1.1em; background: var(--paper); color: var(--ink); border: 2px solid var(--line); border-radius: 8px; font-weight: 700; letter-spacing: .005em; transition: transform .08s ease, box-shadow .08s ease; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--primary { background: var(--yellow); color: #14171c; border-color: #14171c; }
.btn--primary:hover { background: #ffcd3a; }
.btn--xl { min-height: 60px; font-size: 1.35rem; padding-inline: 1.5em; flex: 1 1 100%; justify-content: space-between; text-transform: uppercase; letter-spacing: .02em; }
.btn--small { min-height: 40px; padding: .35em .9em; font-size: .9375rem; }
.btn--quiet { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: .2em; }
.btn--quiet:hover { background: var(--paper-2); box-shadow: none; transform: none; }
.btn--danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn--ghost-danger { background: transparent; color: var(--red); border-color: var(--red); }
.link { background: none; border: 0; padding: 4px 0; color: inherit; text-decoration: underline dotted; text-underline-offset: .2em; font-weight: 600; font-size: .875rem; }
.link:hover { text-decoration-style: solid; }

/* ───── menu ───── */
.menu { position: fixed; inset: 0; z-index: 20; display: flex; pointer-events: none; }
body[data-screen='menu'] .menu__col { padding-top: 58px; }
.menu__col { pointer-events: auto; width: min(560px, 100vw); max-height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 22px 22px; scrollbar-width: thin; }
.sign { display: flex; align-items: center; gap: 16px; background: var(--yellow); color: #14171c; border: 3px solid #14171c; box-shadow: var(--shadow), inset 0 0 0 3px var(--yellow), inset 0 0 0 5px #14171c; border-radius: 14px; padding: 18px 22px; }
.sign__arrow { display: grid; place-items: center; width: 56px; height: 56px; background: #14171c; color: var(--yellow); border-radius: 10px; }
.sign__arrow .i { width: 34px; height: 34px; transform: rotate(45deg); }
.sign__title { margin: 0; font: 800 clamp(2.1rem, 5vw, 2.9rem)/.95 var(--font); text-transform: uppercase; letter-spacing: -.015em; }
.sign__title b { font-weight: 300; margin-left: .12em; }
.sign__sub { margin: 6px 0 0; font-weight: 700; font-size: .9375rem; }

.card { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px 12px 16px; }
.card__label { margin: 0; font: 700 .6875rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.card__name { margin: 0; font-weight: 800; font-size: 1.2rem; line-height: 1.2; overflow-wrap: anywhere; }
.card__stats { margin: 2px 0 0; font: 500 .8125rem/1.35 var(--mono); color: var(--ink-2); }

.block { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px 14px; }
.block__title { margin: 0 0 10px; font: 700 .75rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.block--row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding-block: 12px; }
.block--row .block__title { margin: 0; }

.fleet { display: flex; flex-direction: column; gap: 6px; }
.strip { display: grid; grid-template-columns: 3.4rem 1fr auto; align-items: center; gap: 2px 12px; width: 100%; text-align: left; background: var(--paper); border: 2px solid var(--line); border-radius: 8px; padding: 8px 12px 8px 8px; transition: background .12s ease; }
.strip:hover { background: var(--paper-2); }
.strip__code { display: block; background: var(--ink); color: var(--paper); font: 800 .875rem/1 var(--mono); letter-spacing: .06em; text-align: center; padding: 9px 0; border-radius: 6px; }
.strip__name { font-weight: 800; font-size: 1.1rem; line-height: 1.1; }
.strip__role { font: 600 .75rem var(--mono); color: var(--ink-2); text-align: right; }
.strip__body { display: none; grid-column: 1 / -1; padding: 6px 4px 2px; gap: 8px; }
.strip[aria-checked='true'] { background: var(--yellow); color: #14171c; box-shadow: 4px 4px 0 var(--line); }
.strip[aria-checked='true'] .strip__code { background: #14171c; color: var(--yellow); }
.strip[aria-checked='true'] .strip__role { color: #2b2f36; }
.strip[aria-checked='true'] .strip__body { display: grid; }
.strip__blurb { font-size: .9375rem; line-height: 1.35; font-weight: 600; }
.strip__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 600 .75rem var(--mono); }
.stat__bar { display: inline-flex; gap: 3px; }
.stat__bar i { width: 11px; height: 11px; border: 2px solid #14171c; border-radius: 2px; }
.stat__bar i.is-on { background: #14171c; }

.paint { display: flex; gap: 8px; }
.chip { width: 36px; height: 36px; border-radius: 50%; padding: 0; border: 3px solid var(--line); background: linear-gradient(135deg, var(--main) 0 58%, var(--accent) 58% 100%); transition: transform .1s ease; }
.chip:hover { transform: scale(1.1); }
.chip[aria-checked='true'] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--line); }
.paint__name { margin: 0; font: 600 .8125rem var(--mono); color: var(--ink-2); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn:not(.btn--xl) { flex: 1 1 auto; }
.note { margin: 0; background: var(--paper); border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: .9375rem; font-weight: 600; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; color: #f6f3ea; font-size: .8125rem; line-height: 1.4; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.foot p { margin: 0; }
.foot a { color: inherit; }
.foot .donate { color: inherit; }
.foot .link { color: #f6f3ea; }

/* ───── instrumentos (HUD): sempre placas escuras ───── */
.hud { position: fixed; inset: 0; z-index: 15; pointer-events: none; color: var(--hud-ink); }
.hud p { margin: 0; }
.hud__top { position: absolute; top: 12px; left: 0; right: 0; display: flex; justify-content: center; }
.hud__compass { display: flex; align-items: baseline; gap: 8px; background: var(--hud); border: 2px solid #000; border-radius: 8px; padding: 5px 14px; font: 700 1.05rem var(--mono); }
.hud__compass b { color: var(--yellow); }
.hud__weather { position: absolute; top: 54px; background: var(--hud); border: 2px solid #000; border-radius: 8px; padding: 5px 12px; font: 700 .875rem var(--mono); }
.hud__weather.is-bad { background: var(--red); color: #fff; border-color: #fff; }
.hud__score { position: absolute; top: 0; right: 118px; display: flex; gap: 8px; align-items: stretch; }
.score { display: flex; align-items: center; gap: 7px; background: var(--hud); border: 2px solid #000; border-radius: 8px; padding: 0 12px; height: 44px; font: 700 1.05rem var(--mono); white-space: nowrap; }
.score .i { color: var(--yellow); }
.score small { font-size: .65rem; color: #a9b1bb; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.score--coins { font-size: 1.35rem; }
.score--coins .i { width: 1.1em; height: 1.1em; fill: var(--yellow); stroke: #14171c; }
.combo { color: var(--yellow); font-weight: 800; font-size: 1rem; min-width: 1.6rem; }
.coinfx { position: absolute; top: 48px; left: 0; width: 130px; height: 70px; pointer-events: none; }
.pop { position: absolute; left: 12px; top: 0; font: 800 1.4rem var(--mono); color: var(--yellow); text-shadow: 0 2px 0 #000; animation: pop 1s ease-out forwards; }
.pop--special { color: #ff6fb8; font-size: 1.8rem; }
@keyframes pop { from { transform: translateY(0) scale(.7); opacity: 0; } 15% { opacity: 1; transform: translateY(0) scale(1.15); } to { transform: translateY(46px) scale(1); opacity: 0; } }

.hud__left { position: absolute; left: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; width: min(300px, 46vw); }
.gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gauge { display: grid; background: var(--hud); border: 2px solid #000; border-radius: 8px; padding: 6px 12px 7px; line-height: 1.1; }
.gauge__label { font: 600 .625rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: #a9b1bb; }
.gauge__value { font: 800 2.1rem/1.05 var(--mono); color: var(--yellow); font-variant-numeric: tabular-nums; }
.gauge__unit { font: 600 .75rem var(--mono); color: #a9b1bb; margin-top: -2px; }
.gauge--small { padding-block: 4px; }
.gauge--small .gauge__value { font-size: 1.05rem; color: var(--hud-ink); }
.throttle { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: var(--hud); border: 2px solid #000; border-radius: 8px; padding: 7px 12px; --level: 0%; font: 600 .625rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: #a9b1bb; }
.throttle__bar { height: 12px; border: 2px solid #5b636e; border-radius: 3px; overflow: hidden; }
.throttle__bar i { display: block; height: 100%; width: var(--level); background: var(--yellow); transition: width .1s linear; }
.throttle__value { font: 800 .9rem var(--mono); color: var(--hud-ink); letter-spacing: 0; min-width: 2.6rem; text-align: right; }
.status { background: var(--hud); border: 2px solid #000; border-radius: 8px; padding: 6px 12px; font: 800 .8125rem var(--mono); letter-spacing: .06em; color: #c5ccd5; }
.status.is-on { background: var(--green); color: #fff; }
.status.is-busy { background: var(--yellow); color: #14171c; }
.status--small { font-size: .6875rem; padding: 4px 12px; }
.status--small:empty { display: none; }
.status--brake.is-on { background: var(--red); color: #fff; }
.status.is-up { color: #8fd3ff; }
.status--after { display: none; background: #ff7a1a; color: #14171c; }
.status--after.is-on { display: block; }
.stress { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; background: var(--hud); border: 2px solid #000; border-radius: 8px; padding: 6px 12px; font: 700 .6875rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: #c5ccd5; }
.stress__bar { height: 12px; border: 2px solid #5b636e; border-radius: 3px; overflow: hidden; --level: 0%; }
.stress__bar i { display: block; height: 100%; width: var(--level); background: #ff9d1c; }
.stress.is-hot { background: var(--red); color: #fff; animation: blink 0.5s steps(2) infinite; }
.stress.is-hot .stress__bar i { background: #fff; }

.hud__right { position: absolute; right: 14px; bottom: 14px; }
.mini { width: 168px; height: 168px; display: block; border: 3px solid #000; border-radius: 50%; background: #3f89bd; box-shadow: 0 0 0 3px var(--yellow); }

.hint { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); max-width: min(680px, 90vw); text-align: center; background: var(--yellow); color: #14171c; border: 3px solid #14171c; border-radius: 10px; padding: 10px 22px; font: 800 clamp(1.05rem, 2.2vw, 1.4rem)/1.25 var(--font); box-shadow: 4px 4px 0 #14171c; }
.warn { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); background: var(--red); color: #fff; border: 3px solid #fff; border-radius: 10px; padding: 8px 22px; font: 800 clamp(1.1rem, 2.4vw, 1.6rem) var(--mono); letter-spacing: .04em; text-transform: uppercase; animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }
.reticle { position: absolute; left: 0; top: 0; width: 0; height: 0; }
/* O anel do mouse é o MANCHE (quanto se puxa o comando), não a mira: fino e claro, para ninguém confundi-lo com o ponto dourado dos tiros */
.reticle i { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border: 2px solid rgba(244, 241, 232, .9); border-radius: 50%; box-shadow: 0 0 0 1.5px #14171c, inset 0 0 0 1.5px #14171c; }
.reticle-line { position: absolute; left: 0; top: 0; height: 2px; transform-origin: 0 50%; background: repeating-linear-gradient(90deg, rgba(244, 241, 232, .75) 0 8px, transparent 8px 14px); }
/* A mira dos tiros: cruz dourada com folga no meio (onde o tiro vai) e, com um inimigo à frente, a marca de interceptação (onde mirar) */
.sight, .lead { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; will-change: transform; }
.sight i { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; filter: drop-shadow(0 0 1px #14171c) drop-shadow(0 0 1px #14171c);
	background:
		linear-gradient(var(--yellow), var(--yellow)) 50% 0 / 3px 9px no-repeat,
		linear-gradient(var(--yellow), var(--yellow)) 50% 100% / 3px 9px no-repeat,
		linear-gradient(var(--yellow), var(--yellow)) 0 50% / 9px 3px no-repeat,
		linear-gradient(var(--yellow), var(--yellow)) 100% 50% / 9px 3px no-repeat; }
.sight i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; background: var(--yellow); border-radius: 50%; }
.lead i { position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border: 3px solid #f4f1e8; border-radius: 50%; box-shadow: 0 0 0 2px #14171c, inset 0 0 0 2px #14171c; }
.lead.is-far i { border-style: dashed; opacity: .6; }
/* "pode atirar": o anel vira um disco cheio (a forma muda, não só a cor) */
.lead.is-on i { border-color: #ff4a3d; background: #ff4a3d; transform: scale(.62); }

/* ───── pausa e queda ───── */
.overlay { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; background: rgba(10, 14, 20, .5); padding: 16px; }
.overlay--crash { background: rgba(60, 12, 10, .55); }
.panel { width: min(440px, 100%); background: var(--paper); border: 3px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 14px; }
.panel--crash { border-color: var(--red); }
.panel__title { margin: 0; font: 800 2rem/1 var(--font); text-transform: uppercase; }
.panel--crash .panel__title { color: var(--red); }
.panel__lead { margin: 0; font-weight: 700; font-size: 1.1rem; }
.panel__actions { display: grid; gap: 8px; }
.panel__note { margin: 0; font-size: .875rem; color: var(--ink-2); }

/* ───── janelas ───── */
.sheet { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; background: var(--paper); color: var(--ink); border: 3px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; }
.sheet--wide { width: min(720px, calc(100vw - 24px)); }
.sheet--narrow { width: min(430px, calc(100vw - 24px)); padding: 20px; gap: 10px; }
.sheet::backdrop { background: rgba(10, 14, 20, .62); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 10px 20px; }
.sheet__title { margin: 0; font: 800 1.45rem/1.15 var(--font); text-transform: uppercase; letter-spacing: .005em; }
.sheet__text { margin: 0; padding: 0 20px 12px; color: var(--ink-2); font-weight: 500; }
.sheet--narrow .sheet__text { padding: 0; }
.sheet__body { padding: 8px 20px 16px; overflow-y: auto; flex: 1 1 auto; min-height: 120px; }
.sheet__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 20px 16px; border-top: 2px solid var(--line); }
.sheet--narrow .sheet__actions { border: 0; padding: 8px 0 0; }
.sheet__actions--stack { flex-direction: column; border: 0; padding-top: 4px; }
.sheet__actions--stack .btn { width: 100%; }
#pilotDlg form { padding: 0 20px 18px; }
#pdDone { padding-bottom: 14px; }
#pdDone .sheet__actions { padding-inline: 20px; }
.tabs { display: flex; gap: 6px; padding: 0 20px; border-bottom: 2px solid var(--line); overflow-x: auto; }
.tab { background: transparent; border: 2px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; padding: 9px 16px; font-weight: 700; margin-bottom: -2px; white-space: nowrap; }
.tab:hover { background: var(--paper-2); }
.tab[aria-selected='true'] { background: var(--ink); color: var(--paper); border-color: var(--line); }

.field { padding-bottom: 8px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input { width: 100%; min-height: 48px; background: var(--paper); border: 2px solid var(--line); border-radius: 8px; padding: 8px 12px; font: 700 1.15rem var(--font); letter-spacing: .01em; }
#pdCode { font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.field input[aria-invalid='true'] { border-color: var(--red); }
.field__help { margin: 6px 0 0; font-size: .875rem; color: var(--ink-2); min-height: 1.3em; }
.field__error { margin: 0 0 8px; min-height: 1.4em; color: var(--red); font-weight: 700; }
.codebox { margin: 0 20px 14px; background: var(--ink); color: var(--paper); border-radius: 10px; padding: 14px; text-align: center; }
.codebox code { font: 800 1.5rem var(--mono); letter-spacing: .1em; user-select: all; }

/* opções */
.opts { display: grid; gap: 4px; }
.opt { display: grid; grid-template-columns: 1fr minmax(0, 1.1fr); align-items: center; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--paper-2); }
.opt__label { font-weight: 700; }
.opt__control { display: flex; align-items: center; gap: 12px; justify-content: flex-end; min-width: 0; }
.opt__out { font: 700 .875rem var(--mono); min-width: 3.4rem; text-align: right; }
.opt__hint { grid-column: 1 / -1; margin: 0; color: var(--ink-2); font-size: .8125rem; line-height: 1.4; }
.opt input[type='range'] { -webkit-appearance: none; appearance: none; flex: 1; height: 28px; background: transparent; --fill: 50%; }
.opt input[type='range']::-webkit-slider-runnable-track { height: 10px; border: 2px solid var(--line); border-radius: 3px; background: linear-gradient(90deg, var(--yellow) var(--fill), var(--paper-2) var(--fill)); }
.opt input[type='range']::-moz-range-track { height: 10px; border: 2px solid var(--line); border-radius: 3px; background: linear-gradient(90deg, var(--yellow) var(--fill), var(--paper-2) var(--fill)); }
.opt input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 26px; margin-top: -9px; background: var(--ink); border: 2px solid var(--paper); border-radius: 5px; box-shadow: 0 0 0 2px var(--line); }
.opt input[type='range']::-moz-range-thumb { width: 18px; height: 22px; background: var(--ink); border: 2px solid var(--paper); border-radius: 5px; }
.switch { display: inline-flex; align-items: center; gap: 10px; background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 3px 14px 3px 3px; min-height: 40px; font-weight: 700; }
.switch__knob { width: 30px; height: 30px; border-radius: 50%; background: var(--ink-2); transition: transform .15s ease, background .15s ease; }
.switch[aria-checked='true'] { background: var(--yellow); color: #14171c; border-color: #14171c; }
.switch[aria-checked='true'] .switch__knob { background: #14171c; transform: translateX(0); }
.switch[aria-checked='false'] .switch__text::before { content: '✕ '; }
.switch[aria-checked='true'] .switch__text::before { content: '✓ '; }
.segments { display: flex; flex-wrap: wrap; gap: 0; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; justify-content: flex-end; }
.segment { background: var(--paper); border: 0; border-left: 2px solid var(--line); padding: 8px 12px; font-weight: 700; font-size: .9rem; min-height: 40px; }
.segment:first-child { border-left: 0; }
.segment[aria-checked='true'] { background: var(--yellow); color: #14171c; }
.select { min-height: 42px; background: var(--paper); border: 2px solid var(--line); border-radius: 8px; padding: 6px 10px; font-weight: 700; max-width: 100%; }

/* ranking */
.pilotbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 0 20px 12px; }
.pilotbar__text { margin: 0 auto 0 0; }
.pilotbar .btn { min-height: 38px; font-size: .875rem; }
.pilotbar .is-code code { font: 700 .95rem var(--mono); letter-spacing: .08em; }
.board { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.board__row, .board__me { display: grid; grid-template-columns: 2.6rem 1fr auto auto; align-items: center; gap: 10px; background: var(--paper); border: 2px solid var(--line); border-radius: 8px; padding: 8px 12px; min-height: 46px; }
.board__row:nth-child(1) .board__rank { background: var(--yellow); color: #14171c; }
.board__rank { font: 800 .95rem var(--mono); text-align: center; background: var(--ink); color: var(--paper); border-radius: 6px; padding: 4px 0; }
.board__name { font-weight: 800; overflow-wrap: anywhere; line-height: 1.2; }
.board__value { font: 700 1rem var(--mono); }
.board__tag { font: 700 .6875rem var(--mono); text-transform: uppercase; background: var(--yellow); color: #14171c; padding: 2px 7px; border-radius: 4px; }
.board__row.is-me { background: #fff3c4; color: #14171c; box-shadow: 3px 3px 0 var(--line); }
[data-theme='dark'] .board__row.is-me { background: #4a3d0c; color: var(--ink); }
.board__me { margin: 10px 0 0; border-style: dashed; grid-template-columns: 2.6rem 1fr auto; }
.board__note { margin: 12px 0 0; color: var(--ink-2); font-size: .875rem; }
.is-loading .skel { display: block; height: 18px; border-radius: 4px; background: var(--paper-2); animation: skel 1s ease-in-out infinite alternate; }
@keyframes skel { to { opacity: .45; } }
.empty { display: grid; justify-items: start; gap: 8px; padding: 14px 4px; }
.empty p { margin: 0; color: var(--ink-2); }
.empty--error strong { color: var(--red); }

/* como jogar */
.help { display: grid; gap: 6px; }
.steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 6px; font-weight: 600; }
.help__h { margin: 14px 0 4px; font: 800 .8125rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.keys { margin: 0; display: grid; gap: 6px; }
.keys > div { display: grid; grid-template-columns: 9rem 1fr; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--paper-2); }
.keys dt { font-weight: 800; }
.keys dd { margin: 0; }
.tips { margin: 0; padding-left: 1.2rem; display: grid; gap: 6px; }
.help .usage { margin-top: 14px; color: var(--ink); }

/* aviso curto */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: min(620px, 92vw); background: var(--ink); color: var(--paper); border-radius: 10px; padding: 12px 18px; font-weight: 700; box-shadow: 4px 4px 0 rgba(0, 0, 0, .5); text-align: center; }
body[data-screen='play'] .toast { bottom: auto; top: 76px; }

/* ───── dificuldade, carteira e nível (menu) ───── */
.diff { display: grid; grid-template-columns: repeat(4, 1fr); border: 2px solid var(--line); border-radius: 8px; overflow: hidden; }
.diff__opt { display: grid; gap: 1px; justify-items: center; align-content: center; min-height: 54px; padding: 6px 4px; background: var(--paper); border: 0; border-left: 2px solid var(--line); font-weight: 800; font-size: .9rem; line-height: 1.1; text-align: center; }
.diff__opt:first-child { border-left: 0; }
.diff__opt:hover { background: var(--paper-2); }
.diff__opt small { font: 600 .6875rem var(--mono); color: var(--ink-2); }
.diff__opt[aria-checked='true'] { background: var(--yellow); color: #14171c; }
.diff__opt[aria-checked='true'] small { color: #2b2f36; }
.diff__opt[data-id='hard'][aria-checked='true'] { background: var(--red); color: #fff; }
.diff__opt[data-id='hard'][aria-checked='true'] small { color: #ffe3e0; }
.diff__blurb { margin: 8px 0 0; min-height: 2.8em; font-size: .875rem; color: var(--ink-2); }
.card__wallet { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font: 700 .8125rem var(--mono); }
.card__wallet .i { vertical-align: -.15em; color: var(--yellow-deep); }
.card__wallet .is-gem .i { color: #d6358a; }
.strip__lvl { margin-left: .5em; padding: 1px 6px; border-radius: 4px; background: var(--ink); color: var(--paper); font: 700 .6875rem var(--mono); vertical-align: .12em; }
.strip[aria-checked='true'] .strip__lvl { background: #14171c; color: var(--yellow); }

/* ───── hangar ───── */
.sheet--hangar { width: min(1040px, calc(100vw - 24px)); height: min(840px, calc(100vh - 24px)); }
.sheet--hangar .sheet__head { gap: 12px; flex-wrap: wrap; }
.sheet--hangar .sheet__title { margin-right: auto; }
.hg__wallet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hg__purse { margin: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; background: var(--ink); color: var(--paper); font: 700 .95rem var(--mono); }
.hg__purse .i { color: var(--yellow); }
.hg__purse--gem .i { color: #ff7fc0; }
.hg__sync { margin: 0; font: 600 .75rem var(--mono); color: var(--ink-2); }
.hg__fleet { flex: none; padding-top: 4px; }
.hg__tab { display: grid; justify-items: center; gap: 0; padding: 7px 14px; }
.hg__tablvl { font: 700 .6875rem var(--mono); opacity: .85; }
.hg__body { display: grid; align-content: start; gap: 16px; padding-top: 14px; }
.hg__banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 14px; border: 2px dashed var(--line); border-radius: 8px; background: var(--paper-2); }
.hg__banner--error { border-color: var(--red); }
.hg__bannertext { flex: 1 1 18rem; margin: 0; font-weight: 600; }
.hg__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); align-items: end; gap: 12px 28px; padding-bottom: 14px; border-bottom: 2px solid var(--line); }
.hg__name { margin: 0; font: 800 1.9rem/1 var(--font); text-transform: uppercase; }
.hg__role { margin: 4px 0 0; font: 600 .8125rem var(--mono); color: var(--ink-2); }
.hg__lvlnum { font: 800 1.25rem var(--mono); }
.hg__xp { display: block; height: 14px; margin: 6px 0 4px; border: 2px solid var(--line); border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.hg__xp i { display: block; width: var(--level, 0%); height: 100%; background: repeating-linear-gradient(90deg, var(--yellow) 0 12px, var(--yellow-deep) 12px 16px); transition: width .4s ease; }
.hg__xptext { margin: 0; font-size: .875rem; color: var(--ink-2); }
.hg__cols { display: grid; grid-template-columns: minmax(190px, 240px) minmax(0, 1fr); align-items: start; gap: 20px; }
.hg__sheet { position: sticky; top: 0; padding: 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); }
.hg__h { margin: 0 0 8px; font: 800 .75rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.hg__rows { margin: 0; display: grid; gap: 7px; }
.hg__rows > div { display: grid; padding-bottom: 6px; border-bottom: 1px solid var(--paper-2); }
.hg__rows dt { font: 600 .75rem var(--mono); color: var(--ink-2); }
.hg__rows dd { margin: 0; font-weight: 800; }
.hg__rows .is-up dd { color: #146c3b; }
[data-theme='dark'] .hg__rows .is-up dd { color: #6fdc9b; }
.hg__families { display: grid; gap: 20px; }
.hg__grid { display: grid; gap: 10px; }
.hg__card { display: grid; gap: 6px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); }
.hg__card.is-blocked { opacity: .62; border-style: dashed; }
.hg__card.is-max { background: var(--paper-2); }
.hg__card.is-bought { animation: bought .8s ease; }
@keyframes bought { 0% { box-shadow: 0 0 0 0 var(--yellow); } 35% { box-shadow: 0 0 0 9px var(--yellow); } 100% { box-shadow: 0 0 0 0 transparent; } }
.hg__cardtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hg__cardname { margin: 0; font: 800 1.05rem/1.2 var(--font); }
.hg__pips { display: inline-flex; gap: 4px; flex: none; }
.hg__pips i { width: 13px; height: 13px; border: 2px solid var(--line); border-radius: 2px; }
.hg__pips i.is-on { background: var(--yellow); }
.hg__cardtext { margin: 0; font-size: .9rem; color: var(--ink-2); }
.hg__effect { margin: 0; display: grid; gap: 1px; font: 600 .8125rem var(--mono); }
.hg__next { color: var(--ink-2); }
.hg__buy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; }
.hg__cost { display: inline-flex; gap: 6px; }
.hg__chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; background: var(--ink); color: var(--paper); font: 700 .875rem var(--mono); }
.hg__chip .i { color: var(--yellow); }
.hg__chip--gem .i { color: #ff7fc0; }
.hg__btn { margin-left: auto; min-width: 9.5rem; }
.hg__state { flex-basis: 100%; margin: 0; display: flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.hg__state--max { color: #146c3b; }
[data-theme='dark'] .hg__state--max { color: #6fdc9b; }
.hg__either { display: grid; gap: 8px; padding: 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.hg__eitherlabel { margin: 0; font: 800 .6875rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.hg__or { justify-self: center; position: relative; z-index: 1; margin-block: -4px; padding: 2px 14px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 800 .8rem var(--mono); }
.hg__skeleton { display: grid; gap: 10px; }
.hg__skeleton .skel { height: 104px; background: var(--paper-2); animation: skel 1s ease-in-out infinite alternate; }

/* ───── combate: instrumentos e marcas ───── */
.cmb { display: grid; gap: 4px; }
.cmb__row { margin: 0; display: grid; grid-template-columns: 7.4rem 1fr 4.6rem; align-items: center; gap: 8px; padding: 5px 10px; background: var(--hud); border: 2px solid #000; border-radius: 8px; font: 700 .6875rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: #c5ccd5; }
.cmb__label { display: inline-flex; align-items: center; gap: 5px; }
.cmb__bar { height: 12px; border: 2px solid #5b636e; border-radius: 3px; overflow: hidden; --level: 100%; }
.cmb__bar i { display: block; width: var(--level); height: 100%; background: #43c47a; transition: width .12s linear; }
.cmb__bar.is-mid i { background: #ffc20e; }
.cmb__bar.is-low i { background: #ff4a3d; }
.cmb__bar--heat i { background: #ffc20e; }
.cmb__bar--heat.is-hot i { background: #ff7a1a; }
.cmb__row b { text-align: right; font: 800 .8125rem var(--mono); letter-spacing: 0; color: var(--hud-ink); }
.cmb__row.is-alert { background: var(--red); color: #fff; animation: blink .5s steps(2) infinite; }
.cmb__pips { display: flex; flex-wrap: wrap; gap: 4px; }
.cmb__pips i { width: 12px; height: 12px; background: var(--yellow); border: 2px solid #000; }
.cmb__pips i.is-off { background: transparent; border-color: #5b636e; }
.score--kills .i { color: #ff6a52; }
.score--xp { color: #8fd3ff; }
.foes { position: absolute; inset: 0; overflow: hidden; }
.foe { position: absolute; left: 0; top: 0; will-change: transform; }
.foe__box { --c: #ff4a3d; position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; background:
	linear-gradient(var(--c), var(--c)) 0 0 / 12px 3px no-repeat, linear-gradient(var(--c), var(--c)) 0 0 / 3px 12px no-repeat,
	linear-gradient(var(--c), var(--c)) 100% 0 / 12px 3px no-repeat, linear-gradient(var(--c), var(--c)) 100% 0 / 3px 12px no-repeat,
	linear-gradient(var(--c), var(--c)) 0 100% / 12px 3px no-repeat, linear-gradient(var(--c), var(--c)) 0 100% / 3px 12px no-repeat,
	linear-gradient(var(--c), var(--c)) 100% 100% / 12px 3px no-repeat, linear-gradient(var(--c), var(--c)) 100% 100% / 3px 12px no-repeat; }
.foe--boss .foe__box { --c: #ff9d1c; left: -28px; top: -28px; width: 56px; height: 56px; }
.foe__tag { position: absolute; left: 26px; top: -22px; padding: 1px 6px; border: 1px solid #000; border-radius: 3px; background: #14171c; color: #fff; font: 800 .6875rem var(--mono); white-space: nowrap; }
.foe__hp { position: absolute; left: -20px; top: 24px; width: 40px; height: 5px; border: 1px solid #000; background: #14171c; --level: 100%; }
.foe--boss .foe__hp { left: -28px; top: 32px; width: 56px; }
.foe__hp i { display: block; width: var(--level); height: 100%; background: #ff4a3d; }
.foe__arrow { display: none; width: 0; height: 0; margin: -11px 0 0 -11px; border-right: 11px solid transparent; border-bottom: 22px solid #ff4a3d; border-left: 11px solid transparent; }
.foe--arrow .foe__arrow { display: block; }
.foe--arrow .foe__box, .foe--arrow .foe__tag, .foe--arrow .foe__hp { display: none; }
.lockbox { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.lockbox i { position: absolute; left: -32px; top: -32px; width: 64px; height: 64px; border: 3px solid var(--yellow); border-radius: 50%; box-shadow: 0 0 0 2px #14171c; }
.lockbox span { position: absolute; left: -44px; top: 40px; width: 88px; padding: 1px 0; border-radius: 3px; background: #14171c; color: var(--yellow); font: 800 .75rem var(--mono); text-align: center; }
.lockbox.is-locked i { border-color: #ff4a3d; border-radius: 4px; transform: rotate(45deg); animation: blink .35s steps(2) infinite; }
.lockbox.is-locked span { background: var(--red); color: #fff; }
.hitfx { position: absolute; inset: 0; pointer-events: none; opacity: 0; border: 12px solid var(--red); box-shadow: inset 0 0 90px rgba(200, 48, 42, .55); }
.hitfx.is-hit { animation: hitfx .4s ease-out; }
.hitfx.is-low { animation: lowhp 1.1s ease-in-out infinite; }
@keyframes hitfx { from { opacity: 1; } to { opacity: 0; } }
@keyframes lowhp { 0%, 100% { opacity: 0; } 50% { opacity: .55; } }
.banner { position: absolute; left: 50%; top: 15%; transform: translateX(-50%); max-width: min(560px, 92vw); margin: 0; padding: 10px 28px; border: 3px solid #14171c; border-radius: 12px; background: var(--yellow); box-shadow: 5px 5px 0 #14171c; color: #14171c; text-align: center; font: 800 clamp(1.2rem, 2.6vw, 1.9rem)/1.15 var(--font); text-transform: uppercase; animation: banner 3.2s ease both; }
.banner small { display: block; margin-top: 2px; font: 700 .8125rem var(--mono); text-transform: none; }
.banner--bad { background: var(--red); color: #fff; border-color: #fff; box-shadow: 5px 5px 0 #000; }
@keyframes banner { 0% { transform: translate(-50%, -18px) scale(.92); opacity: 0; } 8%, 82% { transform: translate(-50%, 0) scale(1); opacity: 1; } 100% { transform: translate(-50%, 0); opacity: 0; } }
[data-motion='reduced'] .banner, [data-motion='reduced'] .hitfx.is-hit, [data-motion='reduced'] .hg__card.is-bought { animation: none; }
[data-motion='reduced'] .hitfx.is-hit { opacity: .6; }
[data-motion='reduced'] .hitfx.is-low, [data-motion='reduced'] .cmb__row.is-alert, [data-motion='reduced'] .lockbox.is-locked i { animation: none; }
.panel__sum { margin: 0; font: 600 .875rem/1.5 var(--mono); color: var(--ink-2); white-space: pre-line; }

@media (max-width: 860px) {
	.hg__head, .hg__cols { grid-template-columns: 1fr; }
	.hg__sheet { position: static; }
	.sheet--hangar { height: calc(100vh - 24px); }
	.hg__btn { margin-left: 0; flex: 1 1 100%; }
}

/* telas pequenas */
@media (max-width: 760px) {
	.menu__col { width: 100vw; padding: 12px; }
	.hud__score { right: 116px; gap: 4px; }
	.score { padding: 0 8px; font-size: .9rem; }
	.score--coins small { display: none; }
	.hud__left { width: 56vw; }
	.mini { width: 120px; height: 120px; }
	.keys > div { grid-template-columns: 1fr; gap: 2px; }
	.opt { grid-template-columns: 1fr; }
	.opt__control { justify-content: flex-start; }
}
@media (max-height: 700px) {
	.strip__stats { display: none; }
	.sign { padding-block: 12px; }
}

/* menos movimento */
[data-motion='reduced'] *, [data-motion='reduced'] *::before, [data-motion='reduced'] *::after { animation: none !important; transition: none !important; }
[data-motion='reduced'] .vignette { display: none; }
@media (prefers-contrast: more) { :root { --ink-2: var(--ink); } }
