/* Gema TCG — chrome compartilhado: topbar fixa + rodapé unificado.
 * Feedback de campo 30/08: mesma hierarquia em todas as páginas, nav das
 * ferramentas à esquerda, perfil à direita, fio separando o topo, footer
 * único com redes sociais. Tokens em tokens.css. */

/* o atributo hidden tem que vencer qualquer display: das páginas (o
   default do navegador perde pra ".x { display: flex }") */
[hidden] { display: none !important; }

.gtop {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
}
.gtop-in {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 52px;
  padding: 0 20px;
}
.gtop-logo { display: flex; align-items: center; color: var(--ink); flex: none; }
.gtop-logo svg { height: 24px; width: auto; display: block; }

.gtop-nav { display: flex; gap: 22px; align-items: baseline; min-width: 0; flex: none; }
.gtop-nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 0 5px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.gtop-nav a:hover { color: var(--ink); }
.gtop-nav a.on {
  color: var(--ink);
  border-image: var(--holo-line) 1;
}

/* busca na topbar (páginas de ferramenta): logo e nav à esquerda, e a busca
   logo depois, na ALTURA CHEIA da barra — emendada nela por dois fios
   verticais, sem caixa própria (ref Alt). Foco = fio holo na base. */
.gtop-search-wrap {
  position: relative;
  align-self: stretch;
  display: flex;
  flex: 1 1 auto;
  min-width: 150px;
}
.gtop-search-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}
#gtopSearch {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13.5px;
  padding: 0 14px 0 44px;
}
#gtopSearch::placeholder { color: var(--muted); }
#gtopSearch:focus { outline: none; background: var(--panel); }
.gtop-search-wrap:focus-within::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--holo-line);
  pointer-events: none;
}
.gtop-sg {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 45;
  background: var(--panel);
  border: 1px solid var(--hairline-2);
  max-height: 320px;
  overflow-y: auto;
}
.gtop-sg-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  background: none;
  border: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 12px;
  cursor: pointer;
  text-align: left;
}
.gtop-sg-row + .gtop-sg-row { border-top: 1px solid var(--hairline); }
.gtop-sg-row:hover, .gtop-sg-row.active { background: var(--panel-2); }
.gtop-sg-row .n { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtop-sg-row .s { color: var(--muted); font-weight: 400; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gtop-right { position: relative; flex: none; margin-left: auto; }
.gtop-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--hairline-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
}
.gtop-login:hover { color: var(--ink); border-color: var(--muted); }
.gtop-login svg { width: 14px; height: 14px; }
.gtop-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--panel);
  border: 1px solid var(--hairline-2);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 10px 14px;
  white-space: nowrap;
  z-index: 41;
}

/* ------------------------------------------------------------------ footer */

.gfoot {
  border-top: 1px solid var(--hairline);
  padding: 26px 20px 42px;
  background: var(--bg);
}
.gfoot-in {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.gfoot-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.gfoot-loc { color: var(--muted); font-size: 0.8rem; }
.gfoot-social { margin-left: auto; display: flex; gap: 8px; }
.gfoot-social span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--hairline);
  color: var(--muted);
  cursor: default;
}
.gfoot-social svg { width: 14px; height: 14px; }
.gfoot-legal {
  flex: 1 1 100%;
  color: var(--muted);
  font-size: 0.76rem;
  max-width: 640px;
  line-height: 1.6;
}

@media (max-width: 800px) {
  /* 3 linhas compactas: logo + perfil · nav · busca sangrando até as bordas */
  .gtop-in { flex-wrap: wrap; min-height: 0; padding: 10px 20px 0; }
  .gtop-logo { order: 0; }
  .gtop-right { order: 1; }
  /* a nav não cabe em 375px: rola de lado, sangrando até as bordas, sem barra */
  .gtop-nav {
    order: 2;
    flex: 1 1 100%;
    margin: 10px -20px 0;
    padding: 0 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .gtop-nav::-webkit-scrollbar { display: none; }
  .gtop-search-wrap {
    order: 4;
    flex: 1 1 100%;
    align-self: auto;
    height: 44px;
    margin: 10px -20px 0;
    border-top: 1px solid var(--hairline);
  }
  #gtopSearch { border-left: 0; border-right: 0; padding-left: 48px; }
  .gtop-search-wrap svg { left: 20px; }
}
@media (max-width: 640px) {
  .gtop-in { gap: 16px; }
  .gtop-nav { gap: 14px; }
  .gtop-nav a { font-size: 10.5px; letter-spacing: 0.05em; }
  .gtop-login span { display: none; }
}

/* ------------------------------------------------------------ conta (01/09) */
/* Botão do topo logado: inicial num quadrado + apelido; menu em coluna. */

.gtop-login.is-user { padding: 5px 12px 5px 5px; gap: 10px; }
.gtop-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--panel-2);
  border: 1px solid var(--hairline-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}
.gtop-uname { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtop-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--hairline-2);
  z-index: 41;
  display: flex;
  flex-direction: column;
}
.gtop-menu-who {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 10px 14px 9px;
  border-bottom: 1px solid var(--hairline);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gtop-menu a, .gtop-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
}
.gtop-menu a:last-child, .gtop-menu button:last-child { border-bottom: 0; }
.gtop-menu a:hover, .gtop-menu button:hover { background: var(--panel-2); }
.gtop-menu button { color: var(--muted); }

/* modal de login: e-mail -> código. Um único momento holo (o CTA). */
.gmodal-open { overflow: hidden; }
.gmodal { position: fixed; inset: 0; z-index: 60; }
.gmodal-back { position: absolute; inset: 0; background: rgba(8, 9, 11, 0.72); }
.gmodal-box {
  position: relative;
  width: min(440px, calc(100% - 32px));
  margin: 12vh auto 0;
  background: var(--panel);
  border: 1px solid var(--hairline-2);
  padding: 28px 28px 24px;
  color: var(--ink);
}
.gmodal-x {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
}
.gmodal-x:hover { color: var(--ink); }
.gmodal-eyebrow {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.gmodal-box h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  margin: 6px 0 14px;
}
.gmodal-sub { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin: 0 0 16px; }
.gmodal-sub b { color: var(--ink); font-weight: 600; }
.gmodal-step label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.gmodal-step input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--hairline-2);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.gmodal-step input:focus { outline: none; border-color: var(--ink); }
#gmCode {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-align: center;
}
.gmodal-cta {
  width: 100%;
  background: var(--holo);
  color: #08090B;
  border: 0;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 15px 20px;
  cursor: pointer;
}
.gmodal-cta:hover { filter: brightness(1.06); }
.gmodal-cta[disabled] { opacity: 0.6; cursor: wait; }
.gmodal-hint { min-height: 1.2em; font-size: 0.84rem; color: var(--muted); margin: 10px 0 0; }
.gmodal-hint.error { color: var(--down); }
.gmodal-legal { color: var(--muted); font-size: 0.76rem; line-height: 1.5; margin: 14px 0 0; }
.gmodal-legal a { color: var(--ink); }
.gmodal-alt { margin: 12px 0 0; font-size: 0.82rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.gmodal-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  border-bottom: 1px solid var(--hairline-2);
}
.gmodal-link:hover { border-color: var(--ink); }

/* aviso curto na base da tela */
.gtoast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: var(--panel);
  border: 1px solid var(--hairline-2);
  color: var(--ink);
  font-size: 13px;
  padding: 11px 16px;
  z-index: 70;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100% - 32px);
}
.gtoast.show { opacity: 1; transform: translate(-50%, 0); }

/* rodapé: link de privacidade ao lado da cidade */
.gfoot-link {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
  border-bottom: 1px solid var(--hairline-2);
}
.gfoot-link:hover { color: var(--ink); }

@media (max-width: 640px) {
  .gtop-login.is-user .gtop-uname { display: none; }
  .gtop-login.is-user { padding: 4px; border: 0; }
  .gmodal-box { margin-top: 8vh; padding: 24px 20px 20px; }
}
