/* Efeitos do site: raio + chuva no clique e parallax (Neon Rain), loaders pixelados (Loader Atelier), glitch pontual (Signal/Noise). */
:root { --ciano: #00E5FF; }

/* ---------- tela de carregamento ---------- */
.boot { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--noite); animation: boot-falha 0s 4.5s forwards; }
.boot.out { background: transparent; }
.boot-off .boot { display: none; }
@keyframes boot-falha { to { visibility: hidden; } }
.boot-grid { position: absolute; inset: 0; display: grid; }
.boot-grid i { background: var(--noite); box-shadow: 0 0 0 1px var(--noite); transition: transform 0.42s steps(4), opacity 0.42s steps(4); transition-delay: calc(var(--k) * 16ms); }
.boot.out .boot-grid i { transform: scale(0) rotate(90deg); opacity: 0; }
.boot-c { position: relative; z-index: 1; display: grid; justify-items: center; gap: 14px; text-align: center; transition: opacity 0.25s steps(3), transform 0.25s steps(3); }
.boot.out .boot-c { opacity: 0; transform: scale(0.96); }
.boot-c img { width: 72px; height: 72px; border-radius: 50%; image-rendering: pixelated; box-shadow: 0 0 0 3px var(--papel), 0 0 0 6px var(--verde); }
.pw { display: grid; grid-template-columns: repeat(9, 10px); gap: 4px; margin-top: 6px; }
.pw i { width: 10px; height: 10px; background: var(--n3); animation: onda 1s steps(1) infinite; animation-delay: calc(var(--k) * 60ms); }
.pw i:nth-child(9n + 1), .pw i:nth-child(9n + 2), .pw i:nth-child(9n + 3) { --c: var(--mag); }
.pw i:nth-child(9n + 4), .pw i:nth-child(9n + 5), .pw i:nth-child(9n + 6) { --c: var(--lar); }
.pw i:nth-child(9n + 7), .pw i:nth-child(9n + 8), .pw i:nth-child(9n + 9) { --c: var(--ama); }
@keyframes onda { 0%, 100% { background: var(--n3); } 30% { background: var(--c, var(--ama)); } 60% { background: color-mix(in srgb, var(--c, var(--ama)) 40%, var(--n3)); } }
.boot-t { margin: 6px 0 0; font-family: var(--f-silk); font-weight: 700; font-size: 12px; letter-spacing: 0.2em; color: var(--txt2); }
.boot-n { font-family: var(--f-pixel); font-weight: 400; font-size: 72px; line-height: 0.8; color: var(--ama); font-variant-numeric: tabular-nums; }
.boot-c small { font-size: 13px; color: var(--cinza); }
.boot-c small span { color: var(--papel); }

/* ---------- topo com camadas ---------- */
.hero-alt { cursor: crosshair; }
.hero-alt a, .hero-alt button, .hero-alt .loading { cursor: auto; }
.hero-alt a, .hero-alt button { cursor: pointer; }
.scene { position: absolute; inset: -30px -56px -40px; z-index: -2; overflow: hidden; }
.ly { position: absolute; inset: 0; will-change: transform; }
.ly img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; image-rendering: pixelated; }
.ly-sky img { transition: filter 0.12s steps(2); }
.hero-alt.raio .ly-sky img, .hero-alt.raio .ly-city img { filter: brightness(1.9) saturate(0.6) hue-rotate(-30deg); }
.chuva { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; image-rendering: pixelated; pointer-events: none; }
.flash { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; mix-blend-mode: screen; background: radial-gradient(ellipse 80% 70% at var(--fx, 50%) 0%, rgba(230, 220, 255, 0.95), rgba(160, 150, 255, 0.35) 45%, transparent 80%); }
.hero-alt::after { height: 18%; }

/* painel da estação */
.hud { width: 340px; }
.hud-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed rgba(255, 255, 255, 0.14); font-family: var(--f-silk); font-size: 10px; letter-spacing: 0.16em; color: var(--cinza); }
.rec { display: inline-flex; align-items: center; gap: 6px; color: var(--alerta); }
.rec::before { content: ''; width: 7px; height: 7px; background: var(--alerta); box-shadow: 0 0 10px var(--alerta); animation: pisca 1s steps(2) infinite; }
.hud dl { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, 0.14); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.hud dl div { display: grid; gap: 1px; }
.hud dt { font-family: var(--f-silk); font-size: 9.5px; letter-spacing: 0.14em; color: var(--cinza); }
.hud dd { margin: 0; font-family: var(--f-pixel); font-size: 22px; line-height: 1; color: var(--papel); font-variant-numeric: tabular-nums; }
.sinal { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.sinal i { width: 5px; background: var(--acido); }
.sinal i:nth-child(1) { height: 25%; }
.sinal i:nth-child(2) { height: 50%; }
.sinal i:nth-child(3) { height: 75%; }
.sinal i:nth-child(4) { height: 100%; }
.sinal.fraco i:nth-child(n + 3) { background: var(--n3); }

/* glitch na barra quando o país regride */
.loading.glitch b { text-shadow: -3px 0 var(--mag), 3px 0 var(--ciano); }
.loading.glitch .bar i { filter: hue-rotate(160deg) saturate(2); }
.loading.glitch .loading-top { animation: rasgo 0.5s steps(3) 1; }
@keyframes rasgo {
	0% { clip-path: inset(0 0 0 0); transform: translateX(0); }
	33% { clip-path: inset(10% 0 45% 0); transform: translateX(-6px); }
	66% { clip-path: inset(55% 0 5% 0); transform: translateX(5px); }
	100% { clip-path: inset(0 0 0 0); transform: none; }
}

/* dica do raio */
.ctrl { position: absolute; left: 0; right: 0; bottom: 22px; display: flex; align-items: center; gap: 8px; z-index: 2; }
.dica { font-family: var(--f-silk); font-size: 10px; letter-spacing: 0.14em; color: rgba(245, 243, 238, 0.55); margin-left: 6px; }
.dica::before { content: '⚡ '; }
.d-cel { display: none; }
@media (max-width: 760px) { .d-cel { display: inline; } }

/* plantão */
.plantao { position: relative; z-index: 3; display: flex; align-items: stretch; height: 44px; background: #0f1424; border-block: 1px solid var(--line); overflow: hidden; }
.plantao-tag { flex: none; display: flex; align-items: center; gap: 9px; padding: 0 18px 0 16px; background: var(--alerta); color: #fff; font-family: var(--f-silk); font-weight: 700; font-size: 12px; letter-spacing: 0.16em; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.plantao-tag::before { content: ''; width: 8px; height: 8px; background: #fff; animation: pisca 1s steps(2) infinite; }
.plantao-track { flex: 1; overflow: hidden; display: flex; align-items: center; -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.plantao-run { display: inline-flex; align-items: center; white-space: nowrap; animation: corre 70s linear infinite; }
.plantao-run span { font-family: var(--f-silk); font-size: 12.5px; letter-spacing: 0.08em; color: var(--txt2); padding: 0 26px; }
.plantao-run b { color: var(--ama); font-weight: 700; }
.plantao-run i { font-style: normal; color: var(--mag); font-size: 10px; }
.plantao:hover .plantao-run { animation-play-state: paused; }
@keyframes corre { to { transform: translateX(-50%); } }
.plantao + .taxi { margin-top: 28px; }

/* ---------- loaders pixelados ---------- */
/* digitação dos rótulos */
.kicker.digita::after { content: ''; display: inline-block; width: 0.62em; height: 1em; margin-left: 4px; vertical-align: -0.12em; background: currentColor; animation: pisca 0.7s steps(2) infinite; }

/* esqueleto das thumbs */
.thumb.ld::before, .player.ld::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background:
		linear-gradient(90deg, transparent 0 35%, rgba(255, 255, 255, 0.09) 35% 50%, transparent 50% 100%) 0 0 / 300% 100%,
		repeating-linear-gradient(0deg, rgba(11, 15, 26, 0.5) 0 2px, transparent 2px 8px),
		repeating-linear-gradient(90deg, rgba(11, 15, 26, 0.5) 0 2px, transparent 2px 8px),
		var(--n2);
	animation: brilho 1.3s steps(10) infinite;
}
@keyframes brilho { from { background-position: 100% 0, 0 0, 0 0, 0 0; } to { background-position: -50% 0, 0 0, 0 0, 0 0; } }
.thumb img { opacity: 0; transition: opacity 0.3s steps(3); }
.thumb.ok img { opacity: 1; }

/* onda de pixels enquanto o YouTube carrega */
.pwave { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; grid-auto-flow: column; gap: 6px; background: var(--n1); pointer-events: none; }
.pwave i { width: 12px; height: 12px; background: var(--mag); animation: salta 0.8s steps(4) infinite; animation-delay: calc(var(--k) * 80ms); }
.pwave i:nth-child(n + 4) { background: var(--lar); }
.pwave i:nth-child(n + 7) { background: var(--ama); }
@keyframes salta { 0%, 100% { transform: translateY(0); opacity: 0.35; } 50% { transform: translateY(-14px); opacity: 1; } }
#tv .frame { position: relative; }

/* ---------- bunker: glitch e sinal ---------- */
.bunker::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 3px); opacity: 0.45; animation: tremula 0.14s steps(2) infinite; }
@keyframes tremula { 50% { opacity: 0.36; } }
.bunker > * { position: relative; z-index: 1; }
.sinal-t { color: var(--acido); }
.sinal-t.off { color: var(--alerta); }
.corta { position: relative; }
.corta::before, .corta::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.corta.on { animation: treme 0.18s steps(2) infinite; }
.corta.on::before { opacity: 0.85; color: var(--mag); animation: corte-a 0.3s steps(2) infinite; }
.corta.on::after { opacity: 0.85; color: var(--ciano); animation: corte-b 0.26s steps(2) infinite; }
@keyframes treme { 50% { transform: translateX(2px); } }
@keyframes corte-a {
	0% { clip-path: inset(8% 0 62% 0); transform: translateX(-5px); }
	50% { clip-path: inset(48% 0 22% 0); transform: translateX(4px); }
	100% { clip-path: inset(70% 0 4% 0); transform: translateX(-3px); }
}
@keyframes corte-b {
	0% { clip-path: inset(60% 0 12% 0); transform: translateX(5px); }
	50% { clip-path: inset(15% 0 58% 0); transform: translateX(-4px); }
	100% { clip-path: inset(30% 0 40% 0); transform: translateX(3px); }
}

/* botão vira barra de transmissão e depois ✓ pixelado */
.bunker form button[type='submit']:disabled { position: relative; color: transparent; background: var(--n2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
.bunker form button[type='submit']:disabled::before { content: ''; position: absolute; left: 16px; right: 16px; top: 50%; height: 12px; margin-top: -6px; background: repeating-linear-gradient(90deg, var(--acido) 0 10px, transparent 10px 14px); animation: transmite 1.1s steps(11) infinite; }
@keyframes transmite { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.done .ok { font-size: 0; position: relative; }
.done .ok::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 6px;
	height: 6px;
	margin: -18px 0 0 -21px;
	color: #0b2a12;
	box-shadow: 0 12px, 6px 18px, 12px 24px, 18px 18px, 24px 12px, 30px 6px, 36px 0, 0 18px, 6px 24px, 12px 30px, 18px 24px, 24px 18px, 30px 12px, 36px 6px;
	animation: risca 0.5s steps(7) 0.25s both;
}
.done .ok.aviso { font-size: 44px; }
.done .ok.aviso::before { content: none; }
@keyframes risca { from { clip-path: inset(-10px 48px -60px -10px); } to { clip-path: inset(-10px -60px -60px -10px); } }

/* ---------- celular ---------- */
@media (max-width: 1200px) {
	.hud { width: min(340px, 100%); }
	.hud .hud-h, .hud dl { display: none; }
}
@media (max-width: 760px) {
	.scene { inset: -20px -30px -30px; }
	.hud .hud-h, .hud dl { display: none; }
	.ctrl { bottom: 14px; }
	.d-desk { display: none; }
	.plantao { height: 40px; }
	.plantao-tag { font-size: 10.5px; padding: 0 14px 0 12px; }
	.plantao-run span { font-size: 11px; padding: 0 18px; }
}
@media (prefers-reduced-motion: reduce) {
	.plantao-run { animation: none; }
	.boot { display: none; }
}
