@font-face {
  font-family: 'SF Pro Rounded';
  src: local('SF Pro Rounded Regular'), 
       local('SFProRounded-Regular'),
       url('../assets/fonts/SF-Pro-Rounded-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SF Pro Rounded';
  src: local('SF Pro Rounded Medium'), 
       local('SFProRounded-Medium'),
       url('../assets/fonts/SF-Pro-Rounded-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

body, html {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  height: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background-color: #000000;
  font-family: 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', system-ui, sans-serif;
  color: #f9fafb;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  position: relative;
}

body::-webkit-scrollbar, html::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

* {
  box-sizing: border-box;
  font-family: 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', system-ui, sans-serif;
}

/* Блокировка выделения только для интерфейсных элементов */
button, 
.sidebar, 
.header, 
nav, 
.tab,
.menu-item {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* Разрешаем выделение текста для контента */
p, 
span, 
div[data-message-id],
.message-content,
input,
textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

#root {
  background-color: #000000;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  height: auto;
  width: 100vw;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', system-ui, sans-serif;
  overscroll-behavior: contain;
  -webkit-overscroll-behavior: contain;
  -ms-overscroll-behavior: contain;
  position: relative;
}

html.font-loading body {
  visibility: hidden;
}

html.font-loaded body,
html:not(.font-loading) body {
  visibility: visible;
}

/* Мобильные фиксы для viewport */
:root {
  --vh: 1vh;
}

/* Альтернативная высота для мобильных браузеров */
@supports (height: 100dvh) {
  #root {
    min-height: 100dvh;
  }
}

/* Фикс для iOS Safari */
@media screen and (max-width: 768px) {
  body {
    min-height: calc(var(--vh, 1vh) * 100);
    height: auto;
  }
  
  #root {
    min-height: calc(var(--vh, 1vh) * 100);
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Дополнительные фиксы для прокрутки */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Фикс обрезки контента снизу на мобилке */
@media screen and (max-width: 768px) {
  main {
    padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
  }
}