/* Header: idioma IR + conta / carteira / admin */

.home-top-bar.ff-topbar,
.home-top-bar.ir-topbar,
.ir-topbar {
  overflow: visible !important;
}

.ir-topbar .home-top-actions {
  gap: 0.45rem;
  position: relative;
  z-index: 52;
}

.ir-header-util,
a.ir-header-util,
button.ir-header-util,
.ir-header-util.home-tab-button,
.ir-header-util.ir-btn {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.35rem !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 2.55rem !important;
  max-width: 13.5rem;
  margin: 0 !important;
  padding: 0.35rem 0.7rem !important;
  border: 1.5px solid #ff0015 !important;
  border-radius: 0.65rem !important;
  background: #0a0a0a !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  overflow: visible !important;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ir-header-util:hover {
  border-color: #ff0015 !important;
  background: #ff0015 !important;
  color: #fff !important;
}

.ir-header-util .material-symbols-outlined {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.85);
}

.ir-header-util:hover .material-symbols-outlined {
  color: #fff !important;
}

.ir-header-util__label {
  overflow: visible;
  text-overflow: clip;
  min-width: 0;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.9);
}

.ir-header-util--credits {
  max-width: none;
  color: #fff;
  border-color: #ff0015 !important;
}

.ir-header-util--aff {
  color: #fff;
  border-color: #ff0015 !important;
}

.ir-header-util--credits:hover,
.ir-header-util--aff:hover {
  color: #fff !important;
  border-color: #ff0015 !important;
  background: #ff0015 !important;
}

.ir-header-util--credits .material-symbols-outlined {
  color: #ffcc00;
}

.ir-header-util--aff .material-symbols-outlined {
  color: rgba(255, 255, 255, 0.85);
}

.ir-header-util--credits:hover .material-symbols-outlined,
.ir-header-util--aff:hover .material-symbols-outlined {
  color: #fff !important;
}

.ir-header-util__timer {
  margin-left: 0.1rem;
  padding: 0.12rem 0.4rem;
  border-radius: 0.35rem;
  background: rgba(0, 0, 0, 0.45);
  color: #ffcc00;
  font-size: 0.58rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.ir-header-util:hover .ir-header-util__timer {
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
}

.ir-header-util--credits .ir-header-util__label {
  color: rgba(255, 255, 255, 0.9);
}

.ir-header-util.home-tab-button--active {
  border-color: #ff0015 !important;
  background: #140808;
}

.ir-header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  border: 1.5px solid #ff0015;
  border-radius: 0.65rem;
  background: #0a0a0a;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ir-header-icon-btn:hover {
  border-color: #ff0015;
  background: #ff0015;
  color: #fff;
}

.ir-header-icon-btn .material-symbols-outlined {
  font-size: 1.25rem;
  line-height: 1;
}

.ir-header-icon-btn[hidden] {
  display: none !important;
}

/* Idioma — estilo imagine.red */
.ir-lang {
  position: relative;
  z-index: 50;
}

.ir-lang__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.55rem;
  max-width: 10.5rem;
  padding: 0.35rem 0.65rem;
  border: 1.5px solid #ff0015;
  border-radius: 0.65rem;
  background: #000;
  color: #f5f0e6;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 0, 21, 0.15);
}

.ir-lang__trigger:hover,
.ir-lang.is-open .ir-lang__trigger {
  background: #0c0000;
  box-shadow: 0 0 14px rgba(255, 0, 21, 0.35);
}

.ir-lang__flag {
  display: block;
  width: 1.15rem;
  height: 0.86rem;
  object-fit: cover;
  border-radius: 0.12rem;
  flex-shrink: 0;
}

.ir-lang__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.ir-lang__caret {
  font-size: 1.05rem !important;
  opacity: 0.85;
  flex-shrink: 0;
}

.ir-lang__menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: 16.5rem;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1.5px solid #ff0015;
  border-radius: 0.55rem;
  background: #000;
  box-shadow: 0 1rem 2.2rem rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 0, 21, 0.2);
  scrollbar-width: thin;
  scrollbar-color: #888 #1a1a1a;
}

.ir-lang__menu[hidden] {
  display: none !important;
}

.ir-lang__option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.35rem;
  margin: 0;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: #f5f0e6;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.ir-lang__option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ir-lang__option.is-selected {
  background: #ff0015;
  color: #fff;
}

.ir-lang__option-flag {
  width: 1.25rem;
  height: 0.94rem;
  object-fit: cover;
  border-radius: 0.1rem;
  flex-shrink: 0;
}

.ir-lang__option-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ir-lang__option-check {
  flex-shrink: 0;
  opacity: 0;
  font-size: 1rem;
  font-weight: 800;
}

.ir-lang__option.is-selected .ir-lang__option-check {
  opacity: 1;
}

/* Conta logada */
.ir-account {
  position: relative;
  z-index: 50;
}

.ir-account[hidden] {
  display: none !important;
}

.ir-account__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.55rem;
  max-width: 11rem;
  padding: 0.35rem 0.65rem;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.75rem;
  background: #0a0a0a;
  color: #fff;
  cursor: pointer;
}

.ir-account__trigger:hover,
.ir-account.is-open .ir-account__trigger {
  border-color: rgba(255, 0, 21, 0.55);
  background: #140808;
}

.ir-account__email-short {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 0;
}

.ir-account__caret {
  font-size: 1.05rem !important;
  opacity: 0.8;
}

.ir-account__menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: min(17rem, calc(100vw - 1.5rem));
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--sx-radius, 4px);
  background: #0c0c0c;
  box-shadow: 0 1rem 2.2rem rgba(0, 0, 0, 0.75);
}

.ir-account__menu[hidden] {
  display: none !important;
}

.ir-account__kicker {
  margin: 0;
  color: #ff0015;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ir-account__email {
  margin: 0;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  word-break: break-all;
}

.ir-account__id-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ir-account__id {
  margin: 0;
  flex: 1;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 600;
}

.ir-account__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.45rem;
  background: #151515;
  color: #fff;
  cursor: pointer;
}

.ir-account__copy.is-copied {
  border-color: #ff0015;
  color: #ff6b6b;
}

.ir-account__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  margin-top: 0.15rem;
  border: 1px solid rgba(255, 0, 21, 0.45);
  border-radius: 0.55rem;
  background: rgba(255, 0, 21, 0.12);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.ir-account__logout:hover {
  background: rgba(255, 0, 21, 0.22);
}

/* Menu hambúrguer antigo — fora do header */
.ir-topbar .home-menu-button {
  display: none !important;
}

.home-header-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.home-header-login-button__icon {
  display: none;
  font-size: 1.2rem;
  line-height: 1;
}

.home-header-signup-button__text {
  display: inline;
}

@media (max-width: 1100px) {
  .ir-header-util__label {
    display: none;
  }

  .ir-header-util {
    max-width: none;
    min-width: 2.55rem;
    justify-content: center;
    padding: 0.35rem 0.55rem;
  }

  .ir-header-util--credits .ir-header-util__timer {
    display: none;
  }
}

@media (max-width: 720px) {
  /* Histórico e carteira: redundantes no mobile (abas / conta) */
  .ir-header-util--history,
  .ir-header-icon-btn[data-wallet-open] {
    display: none !important;
  }

  .ir-lang__label,
  .ir-lang__caret {
    display: none !important;
  }

  .ir-lang__trigger {
    max-width: none;
    width: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
    height: 2.35rem;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .ir-account__email-short {
    display: none;
  }

  .ir-topbar .home-top-actions {
    gap: 0.3rem !important;
    min-width: 0;
    flex: 1 1 auto !important;
    justify-content: flex-end;
  }

  .ir-topbar .home-brand-lockup {
    max-width: min(9.5rem, 34vw);
    flex-shrink: 1 !important;
  }

  .ff-topbar .home-header-login-button {
    width: 2.35rem !important;
    min-width: 2.35rem !important;
    min-height: 2.35rem !important;
    height: 2.35rem !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .home-header-login-button__icon {
    display: block !important;
  }

  .home-header-login-button__text {
    display: none !important;
  }

  .ff-topbar .home-header-signup-button:not([hidden]) {
    min-height: 2.35rem !important;
    padding: 0.4rem 0.7rem !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.04em !important;
    white-space: nowrap;
  }

  .ir-header-icon-btn,
  .ir-header-util {
    width: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
    height: 2.35rem;
    padding: 0;
  }
}

@media (max-width: 480px) {
  .ir-header-util--aff {
    display: none !important;
  }

  .site-brand-logo--header .site-brand-logo__word {
    display: none;
  }

  .home-brand-lockup::after {
    display: none;
  }

  .ir-topbar .home-brand-lockup {
    max-width: 2.6rem;
  }

  .home-top-brand-row.ir-topbar {
    gap: 0.35rem !important;
    padding: 0.4rem 0.55rem 0.45rem !important;
  }

  .ff-topbar .home-header-signup-button:not([hidden]) {
    padding: 0.4rem 0.55rem !important;
    font-size: 0.58rem !important;
  }

  .ir-header-icon-btn[data-wallet-open] .material-symbols-outlined {
    font-size: 1.15rem;
  }
}
