/* ══════════════════════════════════════════════════════════════════════════
   spx_home_gateways — Portais da Home (Faixa 1 Ferramentas + Faixa 2 Dominios B3)
   Injetado via $document->addStyle (?v=filemtime) pelos controllers dos modulos
   spellboxstorm_text_boxes (#34) e spellboxstorm_aux_banners (#35, modo gateways).
   Deriva do mockup docs/accents_mockups/home_gateways_mockups.html (Estacao 01 + B3),
   com o leque usando <img> REAIS (webp c/ alfa) em vez de silhuetas CSS.
   Namespacing spx-* p/ nao colidir com o tema.
   ══════════════════════════════════════════════════════════════════════════ */
:root {
  --spxg-acc-mtg: #aa00ff; --spxg-acc-pkm: #ffc966;
  --spxg-acc-mesa: #00e5ff; --spxg-acc-rpg: #ff4fd8;
  --spxg-brand2: #aa00ff; --spxg-cyan: #00e5ff;
  --spxg-ink: #e9e9f5; --spxg-muted: rgba(233,233,245,.6);
  --spxg-line: rgba(170,0,255,.16);
  --spxg-mono: 'Cascadia Mono','Consolas',ui-monospace,monospace;
}

/* ══════ FAIXA 1 — FERRAMENTAS ══════ */
.spx-tools {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 1.75rem;
}
.spx-toolcard {
  position: relative; display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, rgba(36,29,71,.92), rgba(20,16,43,.92));
  border: 1px solid var(--spxg-line); border-left: none;
  border-radius: 12px 4px 12px 12px; padding: 16px 18px; overflow: hidden;
  color: var(--spxg-ink); text-decoration: none;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
  --tacc: var(--spxg-brand2);
}
.spx-toolcard::before {           /* linha flutuante no topo (sem top-border) */
  content: ''; position: absolute; top: 0; left: 16px; right: 16px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--tacc) 35%, var(--tacc) 65%, transparent);
  opacity: .5; transition: opacity .22s ease;
}
.spx-toolcard::after {            /* bracket de canto inferior-esquerdo */
  content: ''; position: absolute; bottom: 8px; left: 8px; width: 16px; height: 16px;
  border-bottom: 2px solid var(--tacc); border-left: 2px solid var(--tacc);
  opacity: 0; transform: translate(-4px, 4px); transition: opacity .22s ease, transform .22s ease;
}
.spx-toolcard:hover, .spx-toolcard:focus-visible {
  transform: translateY(-3px); text-decoration: none; color: var(--spxg-ink);
  border-color: color-mix(in srgb, var(--tacc) 55%, transparent);
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--tacc) 60%, transparent);
}
.spx-toolcard:hover::before, .spx-toolcard:focus-visible::before { opacity: 1; }
.spx-toolcard:hover::after,  .spx-toolcard:focus-visible::after  { opacity: .8; transform: translate(0,0); }
.spx-toolcard:focus-visible { outline: 2px solid var(--spxg-cyan); outline-offset: 2px; }
.spx-toolcard .spx-ico {
  flex: 0 0 auto; width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 11px; background: rgba(12,8,28,.7);
  border: 1px solid color-mix(in srgb, var(--tacc) 40%, transparent);
  color: var(--tacc); transition: box-shadow .22s ease;
}
.spx-toolcard:hover .spx-ico, .spx-toolcard:focus-visible .spx-ico {
  box-shadow: 0 0 18px -2px color-mix(in srgb, var(--tacc) 65%, transparent);
}
.spx-toolcard .spx-ico svg { width: 24px; height: 24px; }
.spx-toolcard .spx-txt { min-width: 0; }
.spx-toolcard .spx-txt .t {
  display: block; text-transform: uppercase; letter-spacing: .6px;
  font-size: 14.5px; font-weight: 700; line-height: 1.15; color: #fff;
}
.spx-toolcard .spx-txt .s { display: block; font-size: 12px; color: var(--spxg-muted); margin-top: 3px; line-height: 1.35; text-wrap: pretty; }
.spx-toolcard[data-acc="brand"] { --tacc: var(--spxg-brand2); }
.spx-toolcard[data-acc="cyan"]  { --tacc: var(--spxg-cyan); }
.spx-toolcard[data-acc="gold"]  { --tacc: var(--spxg-acc-pkm); }

/* ══════ FAIXA 2 — DOMINIOS (B3 Leque de Cartas, imagens reais) ══════ */
.spx-gateways { display: grid; gap: 16px; margin-bottom: 1.75rem; }
.spx-gateways[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.spx-gateways[data-count="4"] { grid-template-columns: repeat(2, 1fr); }  /* 2x2 desktop */

.spx-gw {
  position: relative; display: block; min-height: 262px; border-radius: 12px 4px 12px 12px;
  overflow: hidden; isolation: isolate; cursor: pointer; color: var(--spxg-ink); text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--acc) 28%, var(--spxg-line));
  transition: transform .28s ease, box-shadow .28s ease;
}
.spx-gw:hover, .spx-gw:focus-visible {
  transform: translateY(-3px); text-decoration: none; color: var(--spxg-ink);
  box-shadow: 0 20px 44px -20px color-mix(in srgb, var(--acc) 70%, transparent);
}
.spx-gw:focus-visible { outline: 2px solid var(--spxg-cyan); outline-offset: 3px; }

/* nebulosa da cor do dominio (base do B3) + granulado de estrelas */
.spx-gw-neb {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 120% at 80% 20%, color-mix(in srgb, var(--acc) 24%, transparent), transparent 60%),
    radial-gradient(90% 80% at 15% 90%, color-mix(in srgb, var(--acc2) 18%, transparent), transparent 62%),
    #0c0922;
  transition: filter .35s ease;
}
.spx-gw-neb::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 85% 55%, rgba(255,255,255,.3), transparent);
  opacity: .55;
}
.spx-gw:hover .spx-gw-neb, .spx-gw:focus-visible .spx-gw-neb { filter: saturate(1.2) brightness(1.08); }

/* border-beam da B1 (mockup): anel de luz girando na borda no hover.
   @property/color-mix = browsers recentes; degrade limpo (sem beam, borda estática). */
@property --spxgw-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.spx-gw-beam {
  position: absolute; inset: 0; z-index: 4; border-radius: inherit; padding: 1.6px; pointer-events: none;
  background: conic-gradient(from var(--spxgw-angle), transparent 0 68%, #fff 78%, var(--acc2) 86%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude;
  opacity: 0; transition: opacity .3s ease;
}
.spx-gw:hover .spx-gw-beam, .spx-gw:focus-visible .spx-gw-beam { opacity: 1; animation: spxgw-beamspin 2.4s linear infinite; }
@keyframes spxgw-beamspin { to { --spxgw-angle: 360deg; } }
.spx-gw-scrim {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(9,6,22,.92) 0%, rgba(9,6,22,.58) 55%, rgba(9,6,22,.78) 100%);
}

/* leque de imagens reais (2ª rodada +30% 2026-07-22: 195->254px, pedido do dono — dominar o banner) */
.spx-gw-fan { position: absolute; z-index: 2; right: 18px; top: 30%; width: 284px; height: 321px; pointer-events: none; } /* top 50->30%: composição do leque ~20% mais alta (pedido 2026-07-22) */
.spx-gw-fan .csil {
  position: absolute; left: 50%; top: 50%; height: 254px; width: auto; border-radius: 12px;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.6));
  transition: transform .34s cubic-bezier(.3,.9,.3,1), filter .34s ease;
  transform-origin: center;
}
.spx-gw-fan .csil.c1 { z-index: 1; transform: translate(-50%,-50%) rotate(-15deg) translate(-47px, 10px); }
.spx-gw-fan .csil.c2 { z-index: 3; transform: translate(-50%,-50%) rotate(0deg)  translate(0, -10px); }
.spx-gw-fan .csil.c3 { z-index: 2; transform: translate(-50%,-50%) rotate(15deg)  translate(47px, 10px); }
.spx-gw:hover .csil, .spx-gw:focus-visible .csil {
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.7)) drop-shadow(0 0 13px color-mix(in srgb, var(--acc2) 55%, transparent));
}
.spx-gw:hover .csil.c1, .spx-gw:focus-visible .csil.c1 { transform: translate(-50%,-50%) rotate(-25deg) translate(-91px, 0); }
.spx-gw:hover .csil.c2, .spx-gw:focus-visible .csil.c2 { transform: translate(-50%,-50%) rotate(0deg)  translate(0, -25px) scale(1.05); }
.spx-gw:hover .csil.c3, .spx-gw:focus-visible .csil.c3 { transform: translate(-50%,-50%) rotate(25deg)  translate(91px, 0); }

/* corpo de texto */
.spx-gw-body { position: relative; z-index: 3; padding: 24px 26px; display: flex; flex-direction: column;
  height: 100%; min-height: 262px; justify-content: flex-end; gap: 5px; max-width: 62%; }
.spx-gw-eyebrow { font-family: var(--spxg-mono); font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--acc2); display: inline-flex; align-items: center; }
/* ícone de domínio no eyebrow (SVG do tema tingido pelo accent via mask) */
.spx-gw-ico {
  display: inline-block; width: 16px; height: 16px; margin-right: 8px; flex: 0 0 auto;
  background-color: var(--acc2);
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--acc2) 60%, transparent));
}
.spx-gw-name { font-weight: 700; text-transform: uppercase; letter-spacing: .8px; font-size: clamp(22px, 2.7vw, 31px); line-height: 1.04; color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.55); }
.spx-gw-sub { font-size: 14px; color: rgba(233,233,245,.85); margin-top: 2px; display: flex; align-items: center; gap: 7px; }
.spx-gw-sub .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc2); box-shadow: 0 0 8px var(--acc2); flex: 0 0 auto; }
.spx-gw-cta {
  margin-top: 14px; align-self: flex-start; font-family: var(--spxg-mono); font-size: 12.5px; letter-spacing: .5px;
  color: #fff; border: 1px solid color-mix(in srgb, var(--acc2) 70%, transparent); border-radius: 999px;
  padding: 9px 18px; display: inline-flex; align-items: center; gap: 7px; background: rgba(12,8,28,.35);
  transition: background .22s ease, gap .22s ease, box-shadow .22s ease;
}
.spx-gw:hover .spx-gw-cta, .spx-gw:focus-visible .spx-gw-cta {
  background: color-mix(in srgb, var(--acc) 30%, rgba(12,8,28,.4)); gap: 11px;
  box-shadow: 0 0 16px -3px color-mix(in srgb, var(--acc2) 75%, transparent);
}
.spx-gw-cta .arw { transition: transform .22s ease; }
.spx-gw:hover .spx-gw-cta .arw, .spx-gw:focus-visible .spx-gw-cta .arw { transform: translateX(3px); }

/* ══════ Mobile — empilha 1 coluna ≤720px ══════ */
@media (max-width: 720px) {
  .spx-tools { grid-template-columns: 1fr; }
  .spx-gateways[data-count="3"], .spx-gateways[data-count="4"] { grid-template-columns: 1fr; }
  .spx-gw { min-height: 208px; }
  .spx-gw-body { min-height: 208px; max-width: 60%; }
  .spx-gw-fan { width: 224px; height: 254px; right: 8px; }
  .spx-gw-fan .csil { height: 203px; }
  .spx-gw-fan .csil.c1 { transform: translate(-50%,-50%) rotate(-14deg) translate(-34px, 8px); }
  .spx-gw-fan .csil.c3 { transform: translate(-50%,-50%) rotate(14deg)  translate(34px, 8px); }
}

/* ══════ Promo banner wide (.spx-hbn) — moldura irmã dos portais, "diferentinha" (2026-07-22) ══════
   Diferenças deliberadas vs .spx-gw: notch no canto OPOSTO (BR), ticks na diagonal TR/BL
   (portais usam TL/BR), moldura técnica interna dupla em vez de beam. Mobile-first. */
.horizontal-banner.spx-hbn {
  height: auto; min-height: 168px;
  padding: 20px 18px;
  border-radius: 14px 14px 4px 14px;
  border: 1px solid color-mix(in srgb, #00e5ff 30%, rgba(170, 0, 255, .25));
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .55);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.horizontal-banner.spx-hbn::before {
  background:
    linear-gradient(0deg, rgba(9, 6, 22, .82) 0%, rgba(9, 6, 22, .35) 55%, rgba(9, 6, 22, .12) 100%),
    linear-gradient(90deg, rgba(9, 6, 22, .74) 0%, rgba(9, 6, 22, .28) 55%, rgba(9, 6, 22, .05) 100%);
}
.horizontal-banner.spx-hbn::after {
  content: ''; position: absolute; inset: 7px; z-index: 1; pointer-events: none;
  border: 1px solid color-mix(in srgb, #00e5ff 16%, transparent);
  border-radius: 10px 10px 3px 10px;
}
.spx-hbn-tick { position: absolute; width: 22px; height: 22px; z-index: 2; pointer-events: none; }
.spx-hbn-tick--tr { top: 7px; right: 7px; border-top: 2px solid #00e5ff; border-right: 2px solid #00e5ff; border-top-right-radius: 8px; opacity: .8; }
.spx-hbn-tick--bl { bottom: 7px; left: 7px; border-bottom: 2px solid #aa00ff; border-left: 2px solid #aa00ff; border-bottom-left-radius: 8px; opacity: .6; }
.horizontal-banner.spx-hbn:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, #00e5ff 55%, transparent);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6), 0 0 22px -6px rgba(0, 229, 255, .35);
}
.horizontal-banner.spx-hbn .horizontal-banner-content { z-index: 3; }
.horizontal-banner.spx-hbn h2 { font-size: 1.25rem; letter-spacing: .5px; }
.horizontal-banner.spx-hbn p { color: rgba(233, 233, 245, .9); font-size: .9rem; margin-bottom: 0; }
@media (min-width: 768px) {
  .horizontal-banner.spx-hbn { min-height: 190px; padding: 24px 44px; }
  .horizontal-banner.spx-hbn h2 { font-size: 1.7rem; }
  .horizontal-banner.spx-hbn p { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .spx-toolcard, .spx-gw, .spx-gw-neb, .spx-gw-fan .csil, .spx-gw-cta, .spx-gw-cta .arw,
  .spx-toolcard::before, .spx-toolcard::after, .spx-toolcard .spx-ico { transition-duration: .01ms !important; }
  .spx-gw-beam { animation: none !important; }
  .horizontal-banner.spx-hbn, .horizontal-banner.spx-hbn:hover { transition: none; transform: none; }
  .spx-gw:hover, .spx-gw:focus-visible, .spx-toolcard:hover, .spx-toolcard:focus-visible { transform: none; }
  .spx-gw:hover .csil.c1, .spx-gw:hover .csil.c2, .spx-gw:hover .csil.c3 { transform: translate(-50%,-50%) rotate(0deg); }
}

/* ── Títulos de módulo da HOME no tamanho do "Radar Spellbox" (dono 2026-07-24).
      Escopo body:has(.spx-tr): só a home tem o elemento Tendências — não vaza
      pra deck detail nem landings. top em -em escala o offset flutuante junto;
      o ícone inline dos decks (18px hardcoded no twig) acompanha via override. */
body:has(.spx-tr) .cyber-frame-label {
  font-size: clamp(23px, 3vw, 31px);
  letter-spacing: 2px;
  line-height: 1.05;
  top: -0.6em;
}
body:has(.spx-tr) .cyber-frame-label img {
  width: 30px !important;
  height: 30px !important;
}

/* ── Ritmo vertical UNIFORME entre os módulos da home (dono 2026-07-24):
      os vãos medidos variavam de 8px a 80px. Regra única: 56px entre blocos
      diretos do #content (labels flutuantes respiram dentro do vão). Escopo
      body:has(.spx-tr) = só a home. !important vence os mb-4/mb-5 pontuais. */
body:has(.spx-tr) #content > * {
  margin-top: 0 !important;
  margin-bottom: 56px !important;
}
body:has(.spx-tr) #content > *:last-child {
  margin-bottom: 24px !important;
}

/* ── Trio de banners do grid (Deck Boxes / Sleeves / Playmats) na família
      .spx-hbn — mesma moldura do Acessórios Diversos (dono 2026-07-24):
      borda ciano/roxa, frame técnico interno, ticks TR/BL, arte full-bleed
      com sombra à esquerda pro texto. ── */
.static-banner-card.spx-hbn-card {
  min-height: 200px; display: flex; align-items: center;
  background-size: cover; background-position: center;
  border-radius: 14px 14px 4px 14px;
  border: 1px solid color-mix(in srgb, #00e5ff 30%, rgba(170, 0, 255, .25));
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .55);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.static-banner-card.spx-hbn-card::after {
  content: ''; position: absolute; inset: 7px; z-index: 1; pointer-events: none;
  border: 1px solid color-mix(in srgb, #00e5ff 16%, transparent);
  border-radius: 10px 10px 3px 10px;
}
.spx-hbn-card-shade {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(9, 6, 22, .84) 0%, rgba(9, 6, 22, .40) 55%, rgba(9, 6, 22, .08) 100%);
}
.static-banner-card.spx-hbn-card .banner-content { z-index: 3; }
.static-banner-card.spx-hbn-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, #00e5ff 55%, transparent);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6), 0 0 22px -6px rgba(0, 229, 255, .35);
}
@media (min-width: 992px) { .static-banner-card.spx-hbn-card { min-height: 220px; } }

/* ══════ [SPX revisao1 07/11] Revisão 1 de textos — categorias, banner e cards de acessórios ══════ */
/* cabeçalho da seção de categorias */
.spx-gw-head { margin: 2px 0 16px; }
.spx-gw-titulo { margin: 0; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.1; color: #fff; }
.spx-gw-desc { margin: 5px 0 0; font-size: 15px; color: rgba(233, 233, 245, .72); }
/* cartões: mais respiro; texto embaixo e botão na mesma altura nos quatro */
.spx-gw-body { padding: 28px 32px; gap: 8px; }
.spx-gw-sub { margin-top: 0; max-width: 26ch; line-height: 1.4; text-wrap: pretty; }
.spx-gw-cta { margin-top: 14px; }
@media (max-width: 720px) {
  .spx-gw, .spx-gw-body { min-height: 236px; }
  .spx-gw-body { padding: 22px 22px; }
}

/* botão das categorias, também no banner de acessórios e nos cards (pílula com seta) */
.spx-hbn-cta {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 9px 18px; border-radius: 999px; background: rgba(12, 8, 28, .45);
  border: 1px solid color-mix(in srgb, #c774ff 70%, transparent);
  color: #fff; font-family: var(--spxg-mono); font-size: 12.5px; letter-spacing: .5px; text-decoration: none;
  transition: background .22s ease, box-shadow .22s ease, gap .22s ease;
}
.spx-hbn-cta:hover, .spx-hbn-cta:focus-visible,
.horizontal-banner.spx-hbn:hover .spx-hbn-cta {
  color: #fff; text-decoration: none; gap: 11px;
  background: color-mix(in srgb, #aa00ff 30%, rgba(12, 8, 28, .4));
  box-shadow: 0 0 16px -3px rgba(199, 116, 255, .75);
}

/* banner de acessórios: degradê escuro à esquerda, texto e botão alinhados à esquerda */
.horizontal-banner.spx-hbn::before {
  background:
    linear-gradient(90deg, rgba(9, 6, 22, .94) 0%, rgba(9, 6, 22, .76) 30%, rgba(9, 6, 22, .22) 60%, rgba(9, 6, 22, .04) 100%),
    linear-gradient(0deg, rgba(9, 6, 22, .42) 0%, rgba(9, 6, 22, 0) 60%);
}
.horizontal-banner.spx-hbn .spx-hbn-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 640px; }
.horizontal-banner.spx-hbn .spx-hbn-body h2 { margin-bottom: 0 !important; }
.horizontal-banner.spx-hbn .spx-hbn-desc { margin: 0; }
.horizontal-banner.spx-hbn .spx-hbn-cta { margin-top: 10px; }
@media (min-width: 768px) {
  .horizontal-banner.spx-hbn { min-height: 200px; }
}

/* cards Deck Boxes / Sleeves / Playmats: títulos um pouco menores e iguais nos três */
.static-banner-card.spx-hbn-card h3 { font-size: clamp(1.55rem, 2.1vw, 2rem); line-height: 1.05; margin-bottom: 0; }
