/* HALU brand overrides */
:root {
  --halu-purple: #8B5CF6;
  --halu-cyan: #22D3EE;
  --halu-gold: #F59E0B;
  --halu-dark: #0B0F1A;
  --halu-surface: #151B2E;
  --halu-gradient: linear-gradient(135deg, #8B5CF6 0%, #22D3EE 50%, #F59E0B 100%);
}

.theme--dark {
  background: var(--halu-dark) !important;
}

.btn--blue,
.sidebar__game--hover,
.x30__bet-placed .btn--blue {
  background: linear-gradient(135deg, #7C3AED 0%, #0891B2 100%) !important;
  border: none !important;
}

.btn--blue:hover {
  filter: brightness(1.1);
}

.sidebar__logotype {
  width: 130px !important;
  height: 32px !important;
}

.theme--dark .sidebar__logotype a {
  background: url(../images/logotype-dark.svg) no-repeat center center/contain !important;
}

.sidebar__logotype a {
  background: url(../images/logotype-dark.svg) no-repeat center center/contain !important;
}

.sidebar__game-name {
  background: linear-gradient(135deg, #4C1D95 0%, #155E75 100%) !important;
}

.sidebar__online,
.sidebar__online i {
  color: var(--halu-cyan) !important;
  background: var(--halu-cyan) !important;
  box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.17) !important;
}

/* Avatars — HALU ring */
.sidebar__user-avatar,
.chat__msg-avatar,
.history__user-avatar,
.profile__avatar-img {
  border: 2px solid transparent !important;
  background-origin: border-box !important;
  background-clip: padding-box, border-box !important;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
}

.sidebar__user-avatar {
  background-color: #151B2E !important;
}

.chat__msg-info span {
  color: var(--halu-purple) !important;
}

.footer__text span {
  background: var(--halu-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  letter-spacing: 1px;
}

.popup__tab--active {
  color: var(--halu-cyan) !important;
  border-bottom-color: var(--halu-cyan) !important;
}

.wallet__method--active {
  border-left-color: var(--halu-purple) !important;
}

.bx-input input:focus,
.secodary_input:focus {
  border-color: var(--halu-purple) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25) !important;
}

.preloader__logo {
  background: url(../images/logotype-dark.svg) no-repeat center center/contain !important;
}

/* Auth popup */
.popup.halu-auth {
  max-width: 420px !important;
  width: calc(100% - 32px) !important;
  background: linear-gradient(165deg, #151B2E 0%, #0B0F1A 100%) !important;
  border: 1px solid rgba(139, 92, 246, 0.25);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(34, 211, 238, 0.08) !important;
  padding: 0 !important;
  overflow: hidden;
}

.popup.halu-auth .popup__title {
  display: none;
}

.halu-auth__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s;
}

.halu-auth__close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.halu-auth__hero {
  text-align: center;
  padding: 32px 28px 8px;
}

.halu-auth__logo {
  height: 36px;
  margin-bottom: 16px;
}

.halu-auth__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.halu-auth__subtitle {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

.halu-auth__tabs {
  display: flex;
  gap: 8px;
  margin: 20px 24px 0;
  padding: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
}

.halu-auth__tab {
  flex: 1;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.halu-auth__tab--active {
  background: linear-gradient(135deg, #7C3AED 0%, #0891B2 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.halu-auth__body {
  padding: 20px 24px 8px;
}

.halu-auth__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.halu-auth__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.halu-auth__label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.halu-auth__field input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.halu-auth__field input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.halu-auth__field input:focus {
  border-color: var(--halu-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.halu-auth__submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px !important;
  border-radius: 12px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  border: none !important;
  background: var(--halu-gradient) !important;
  color: #fff !important;
  justify-content: center;
}

.halu-auth__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.halu-auth__note {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  padding: 12px 24px 24px;
  margin: 0;
}

/* CryptoBot deposit banner */
.halu-pay-banner {
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(8, 145, 178, 0.12) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.halu-pay-banner__icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 136, 204, 0.25);
}

.halu-currency {
  font-size: 11px;
  font-weight: 700;
  color: var(--halu-cyan);
  letter-spacing: 0.04em;
  margin-left: 6px;
}

.halu-currency--input {
  margin-left: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

.header__user-b .halu-currency {
  font-size: 10px;
  margin-left: 4px;
}

.halu-pay-banner__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.halu-pay-banner__text strong {
  font-size: 16px;
  color: #fff;
}

.halu-pay-banner__text span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

.halu-pay-btn {
  min-width: 140px;
  justify-content: center;
}

.theme--dark .popup.halu-auth {
  background: linear-gradient(165deg, #151B2E 0%, #0B0F1A 100%) !important;
}

/* Telegram Mini App */
html.tg-miniapp,
body.tg-miniapp {
  height: 100%;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  background: #0B0F1A !important;
}

body.tg-miniapp .sidebar,
body.tg-miniapp .winter,
body.tg-miniapp .mobile-menu,
body.tg-miniapp .mobile-navbar,
body.tg-miniapp .chat,
body.tg-miniapp .close-chat {
  display: none !important;
}

body.tg-miniapp .header__links {
  display: none !important;
}

body.tg-miniapp .header__right .sidebar__logotype {
  display: none !important;
}

body.tg-miniapp .header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 26, 0.92) !important;
  padding: 8px 0;
}

body.tg-miniapp .header .wrapper {
  padding: 0 12px;
}

body.tg-miniapp .header__user-balance-add .btn {
  padding: 8px 14px !important;
  font-size: 12px !important;
}

body.tg-miniapp #app {
  min-height: 100vh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

body.tg-miniapp main {
  padding: 0 12px 12px;
}

body.tg-miniapp .footer {
  display: none !important;
}

body.tg-miniapp .popup {
  max-width: calc(100% - 16px) !important;
  width: calc(100% - 16px) !important;
  margin: 8px;
  max-height: calc(100vh - 80px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}

body.tg-miniapp .overlayed {
  padding: 8px;
  align-items: flex-end;
}

body.tg-miniapp .games {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
}

body.tg-miniapp .games__item {
  min-height: 120px;
}

.tg-appbar {
  display: none;
}

body.tg-miniapp .tg-appbar {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(11, 15, 26, 0.96);
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  backdrop-filter: blur(16px);
  justify-content: space-around;
  gap: 4px;
}

.tg-appbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.2s;
}

.tg-appbar__item .icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.tg-appbar__item--active,
.tg-appbar__item:active {
  color: var(--halu-cyan);
  background: rgba(139, 92, 246, 0.12);
}

.halu-support-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18) 0%, rgba(8, 145, 178, 0.14) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.halu-support-card__icon {
  font-size: 28px;
  line-height: 1;
}

.halu-support-card__body strong {
  display: block;
  color: #fff;
  margin-bottom: 6px;
  font-size: 16px;
}

.halu-support-card__body p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  line-height: 1.4;
}

.halu-support-card__btn {
  display: inline-flex !important;
  padding: 10px 16px !important;
  font-size: 13px !important;
}

body.tg-miniapp .halu-wallet-deposit,
body.tg-miniapp .wallet--refill {
  width: 100% !important;
}

body.tg-miniapp .x30__bet-placed a,
body.tg-miniapp .payments a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
