/* BINGO.UZ profile — Instagram-style layout */

.ig-profile {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 !important;
  background: var(--shell-bg, #fff);
}

/* —— Top bar —— */
.ig-profile__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 8px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--shell-bg, #fff);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.12);
}

.ig-profile__topbar-back,
.ig-profile__topbar-menu {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.ig-profile__topbar-menu { font-size: 18px; }

.ig-profile__topbar-center {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-profile__topbar-verified .icon-svg {
  width: 14px;
  height: 14px;
}

/* —— Cover: hidden by default (IG mobile has no banner) —— */
.ig-profile__cover {
  display: none !important;
}

.ig-profile__body {
  position: relative !important;
  z-index: 2 !important;
  margin-top: 0 !important;
  padding: 12px 16px 0 !important;
  background: transparent;
}

/* —— Header: avatar + stats —— */
.ig-profile__header,
.ig-profile__header.profile-header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}

.ig-profile__avatar-wrap {
  width: 77px !important;
  height: 77px !important;
  flex-shrink: 0 !important;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.ig-profile__avatar-wrap .avatar,
.ig-profile__avatar-wrap #profileAvatar {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.ig-profile__avatar-wrap #profileAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.ig-profile__stats,
.ig-profile__stats.profile-stats {
  flex: 1 1 auto !important;
  display: flex !important;
  justify-content: space-around !important;
  align-items: center !important;
  gap: 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  backdrop-filter: none !important;
}

.ig-profile__stats .profile-stat {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 !important;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  color: inherit;
}

.ig-profile__stats .profile-stat-value {
  display: block;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #262626;
}

.ig-profile__stats .profile-stat-label {
  display: block;
  font-size: 13px !important;
  color: #262626 !important;
  margin-top: 2px;
  font-weight: 400;
}

.ig-profile__stats .profile-stat--link {
  cursor: pointer;
}

/* —— Identity —— */
.ig-profile__identity {
  padding: 12px 0 0 !important;
}

.ig-profile__identity .profile-name {
  font-size: 14px !important;
  font-weight: 600 !important;
  margin: 0 0 2px !important;
  color: #262626;
}

.ig-profile__identity .profile-bio {
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  color: #262626;
  margin: 0 !important;
}

.ig-profile__identity .profile-link {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #00376b;
}

/* —— Action buttons (IG style) —— */
.ig-profile__actions.profile-actions {
  display: flex !important;
  gap: 8px !important;
  align-items: center;
  margin-top: 12px !important;
  padding: 0 0 16px !important;
  width: 100% !important;
}

.btn-ig {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  flex: 1 1 0;
}

.btn-ig-primary {
  background: #0095f6;
  color: #fff;
}

.btn-ig-primary:active { background: #1877f2; }

.btn-ig-secondary {
  background: #efefef;
  color: #262626;
}

.btn-ig-secondary:active { background: #dbdbdb; }

.btn-ig-icon {
  flex: 0 0 32px !important;
  min-width: 32px !important;
  width: 32px;
  padding: 0;
  background: #efefef;
  color: #262626;
}

.btn-ig-icon .icon-svg,
.btn-ig-icon .nav-icon svg {
  width: 16px;
  height: 16px;
}

/* —— Stories / highlights —— */
#profileStoriesBar {
  position: relative;
  z-index: 1;
  padding: 0 12px !important;
}

#profileStoriesBar .stories-bar,
#profileStoriesBar .profile-stories-bar {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 0 12px;
  border-top: 0.5px solid rgba(60, 60, 67, 0.12);
  border-bottom: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#profileStoriesBar .stories-bar::-webkit-scrollbar { display: none; }

#profileStoriesBar .story-bubble {
  flex: 0 0 64px;
  width: 64px;
  max-width: 64px;
}

#profileStoriesBar .story-bubble .story-ring {
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
}

#profileStoriesBar .story-bubble-name {
  max-width: 64px;
  width: 64px;
  font-size: 12px;
  color: #262626;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— Tabs —— */
.ig-profile .profile-tabs {
  display: flex;
  border-top: 0.5px solid rgba(60, 60, 67, 0.12);
  margin: 0;
  padding: 0;
}

.ig-profile .profile-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #8e8e93;
  border-bottom: 1px solid transparent;
  margin-bottom: -0.5px;
}

.ig-profile .profile-tab.active {
  color: #262626;
  border-bottom-color: #262626;
}

.ig-profile .profile-tab .icon-svg,
.ig-profile .profile-tab .nav-icon svg {
  width: 24px;
  height: 24px;
}

/* —— Post grid —— */
.ig-profile .profile-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 2px !important;
  padding: 0 !important;
  margin: 0 !important;
}

.ig-profile .profile-grid-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #fafafa;
  cursor: pointer;
}

.ig-profile .profile-grid-item img,
.ig-profile .profile-grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-grid-video-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

.profile-grid--products {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
  padding: 8px 12px 24px !important;
}

.profile-grid-item--product {
  border-radius: 8px;
}

/* —— Empty state —— */
.profile-grid-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
}

.profile-grid-empty__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-grid-empty__desc {
  font-size: 13px;
  color: #8e8e93;
  margin-bottom: 16px;
  line-height: 1.45;
}

/* —— Sheets —— */
.profile-more-sheet,
.follow-list-sheet {
  position: fixed;
  inset: 0;
  z-index: 5000;
}

.profile-more-sheet__backdrop,
.follow-list-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.profile-more-sheet__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
}

#profileExtra { display: none; }

.trust-badge--profile,
.trust-badge--inline { display: none !important; }

/* Profile — keep bottom nav + sidebar visible and tappable */
body.profile-page-active #bottomNav.bottom-nav,
body.profile-page-active nav#bottomNav {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  left: 14px !important;
  right: 14px !important;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 10000 !important;
  contain: none !important;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  touch-action: manipulation;
  isolation: isolate;
}

body.profile-page-active .bottom-nav-link,
body.profile-page-active .bottom-nav-link * {
  pointer-events: auto !important;
  touch-action: manipulation;
  cursor: pointer;
}

body.profile-page-active .ig-profile__topbar {
  top: 0;
}

body.profile-page-active.has-mobile-chrome .ig-profile__topbar {
  position: sticky;
  top: 0;
  z-index: 15;
}

@media (max-width: 768px) {
  body.profile-page-active .bottom-nav,
  body.profile-page-active #bottomNav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
  }

  body.profile-page-active .app-main {
    padding-bottom: var(--mobile-page-pad-bottom, 80px) !important;
  }
}

@media (min-width: 769px) {
  body.profile-page-active #appSidebar,
  body.profile-page-active .app-sidebar {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  body.profile-page-active #bottomNav,
  body.profile-page-active .bottom-nav {
    display: none !important;
  }
}

/* Dark theme — profile */
html[data-theme="dark"] body.profile-page-active .ig-profile {
  background: var(--shell-bg, #050505) !important;
  color: var(--shell-text, #f5f5f4);
}

html[data-theme="dark"] body.profile-page-active .ig-profile__topbar {
  background: var(--shell-bg, #050505);
  border-bottom-color: var(--shell-border);
  color: var(--shell-text);
}

html[data-theme="dark"] body.profile-page-active .ig-profile__stats .profile-stat-value,
html[data-theme="dark"] body.profile-page-active .ig-profile__stats .profile-stat-label,
html[data-theme="dark"] body.profile-page-active .ig-profile__identity .profile-name,
html[data-theme="dark"] body.profile-page-active .ig-profile__identity .profile-bio {
  color: var(--shell-text, #f5f5f4) !important;
}

html[data-theme="dark"] body.profile-page-active .btn-ig-secondary {
  background: #262626 !important;
  color: #f5f5f4 !important;
}

html[data-theme="dark"] body.profile-page-active .ig-profile .profile-tab {
  color: var(--shell-muted);
}

html[data-theme="dark"] body.profile-page-active .ig-profile .profile-tab.active {
  color: var(--shell-text);
  border-bottom-color: var(--shell-text);
}

@media (max-width: 380px) {
  .ig-profile__header { gap: 16px !important; }
  .ig-profile__avatar-wrap {
    width: 70px !important;
    height: 70px !important;
  }
  .ig-profile__stats .profile-stat-value { font-size: 15px !important; }
}

@media (min-width: 769px) {
  .ig-profile__topbar-back { visibility: hidden; pointer-events: none; }
}

/* —— Beat bingo-ig / bingo-apple / features cover & layout conflicts —— */
body.profile-page-active,
body.app-body.profile-page-active {
  overflow-x: hidden;
}

body.profile-page-active .app-main {
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

body.profile-page-active .ig-profile {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
  box-sizing: border-box;
}

body.profile-page-active .ig-profile__cover,
body.profile-page-active .profile-cover {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}

body.profile-page-active .ig-profile__body,
body.app-body.profile-page-active .ig-profile__body {
  margin-top: 0 !important;
  padding: 8px 16px 0 !important;
}

body.profile-page-active .ig-profile__header,
body.profile-page-active .ig-profile__header.profile-header,
body.app-body.profile-page-active .ig-profile__header.profile-header,
body.app-body.profile-page-active .profile-header.ig-profile__header,
body.profile-page-active .app-main .ig-profile__header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.profile-page-active .ig-profile__avatar-wrap,
body.app-body.profile-page-active .ig-profile__avatar-wrap {
  width: 77px !important;
  height: 77px !important;
  padding: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

body.profile-page-active .ig-profile__avatar-wrap .avatar,
body.profile-page-active .ig-profile__avatar-wrap .avatar-xl,
body.profile-page-active .ig-profile__avatar-wrap #profileAvatar {
  width: 100% !important;
  height: 100% !important;
  font-size: 24px !important;
}

body.profile-page-active .ig-profile__stats,
body.profile-page-active .ig-profile__stats.profile-stats,
body.app-body.profile-page-active .ig-profile__stats.profile-stats,
body.profile-page-active .app-main .ig-profile__stats {
  flex: 1 1 auto !important;
  display: flex !important;
  justify-content: space-around !important;
  align-items: center !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  min-width: 0 !important;
}

body.profile-page-active .ig-profile__actions.profile-actions,
body.app-body.profile-page-active .ig-profile__actions.profile-actions,
body.profile-page-active .app-main .ig-profile__actions {
  display: flex !important;
  gap: 8px !important;
  width: 100% !important;
  margin-top: 12px !important;
  padding: 0 0 12px !important;
  box-sizing: border-box;
}

body.profile-page-active .btn-ig {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.profile-page-active .ig-profile .profile-grid,
body.app-body.profile-page-active .ig-profile .profile-grid {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

@media (max-width: 380px) {
  body.profile-page-active .ig-profile__header,
  body.profile-page-active .ig-profile__header.profile-header {
    gap: 12px !important;
  }
  body.profile-page-active .ig-profile__avatar-wrap {
    width: 66px !important;
    height: 66px !important;
  }
  body.profile-page-active .ig-profile__stats .profile-stat-value { font-size: 15px !important; }
  body.profile-page-active .ig-profile__stats .profile-stat-label { font-size: 11px !important; }
  body.profile-page-active .btn-ig {
    font-size: 13px;
    padding: 0 8px;
  }
}
