/* ОСНОВНЫЕ СТИЛИ */
#rusff-app {
  font-family: sans-serif;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.phone-case {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border-radius: 20px;
  padding: 15px;
  border: 3px solid #1a252f;
  width: 80%;
  max-width: 800px;
  margin: 0 auto;
}

.phone-screen {
  background: #f5f5f7;
  border-radius: 15px;
  width: 100%;
  height: 400px;
  display: flex;
  border: 2px solid #1a1a1a;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.1);
}

.side-tabs {
    background: linear-gradient(to bottom, #2d3436, #636e72);
    width: 65px;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-radius: 12px 0 0 12px;
}

.tab-button {
  background: transparent;
  border: none;
  width: 55px;
  height: 55px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #dfe6e9;
  padding: 8px 4px;
  text-decoration: none;
  font-size: 11px;
}

.tab-button.active {
  background: rgba(255,255,255,0.15);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.3);
}

.tab-button:hover {
  background: rgba(255,255,255,0.1);
}

/* Убрали специальные стили для кнопки редактирования, теперь она такая же как остальные */
.tab-button.edit-button {
  margin-top: auto;
  margin-bottom: 10px;
  /* Убрали фиолетовый градиент и сделали такой же как остальные */
}

/* Стиль для неактивной кнопки редактирования */
.tab-button.edit-button.inactive {
  opacity: 0.6;
  cursor: not-allowed;
}

.tab-button.edit-button.inactive:hover {
  background: transparent;
}

.tab-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.tab-text {
  font-size: 11px;
  text-align: center;
  line-height: 1.2;
}

.content-area {
    flex: 1;
    padding: 20px;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    position: relative;
    border-radius: 0 12px 12px 0;
}

.content-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  z-index: 1;
  pointer-events: none;
}

.tab-content, .tab-content > * {
  position: relative;
  z-index: 2;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* УБИРАЕМ ВЕРТИКАЛЬНУЮ ПРОКРУТКУ СО ВСЕХ ВКЛАДОК */
.content-area {
  overflow-y: hidden !important;
}

/* ОСТАВЛЯЕМ ПРОКРУТКУ ТОЛЬКО ДЛЯ НУЖНЫХ КОНТЕЙНЕРОВ */
.home-container, .theme-container, .achievements-container,
.coupons-container, .scrollable-container,
.fitting-room-content, .backgrounds-simple-container {
  overflow-y: auto;
}

/* ИСПРАВЛЕНИЕ: убираем прокрутку на главной вкладке */
#home-tab {
  height: 100%;
}

.home-container {
  display: flex;
  gap: 20px;
  height: 100%;
  max-height: 360px;
  min-height: 360px;
  overflow: hidden;
}

.left-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 200px;
  max-height: 100%;
  overflow: hidden;
}

.right-column {
  flex: 1;
  min-width: 200px;
  background: transparent;
}

.profile-section {
  background: rgba(248, 249, 250, 0.9);
  border-radius: 12px;
  padding: 15px;
  border: 1px solid #dee2e6;
  backdrop-filter: blur(5px);
  flex-shrink: 0;
}

.profile-header {
  display: flex;
  gap: 15px;
}

.avatar-container {
  flex-shrink: 0;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-name {
    font-size: 14px;
    font-weight: bold;
    color: #2d3436;
    margin-bottom: 8px;
}

.profile-activity {
    font-size: 10px;
    color: #636e72;
    display: inline-block;
    margin-bottom: 10px;
}

.profile-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.profile-btn {
    flex: 1;
    padding: 4px 8px;
    border: none;
    border-radius: 8px;
    background: #0984e3;
    color: white;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-btn:hover {
  background: #0770c4;
  transform: translateY(-2px);
}

.blocks-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

.block {
  background: rgba(248, 249, 250, 0.9);
  border-radius: 12px;
  padding: 15px;
  border: 1px solid #dee2e6;
  transition: none; /* УБИРАЕМ АНИМАЦИЮ */
  backdrop-filter: blur(5px);
  /* УБИРАЕМ flex-shrink: 0 чтобы блок мог уменьшаться */
  box-sizing: border-box; /* ДОБАВЛЯЕМ ЭТО */
}

.block:hover {
  /* УБИРАЕМ ЭФФЕКТЫ ПРИ НАВЕДЕНИИ */
  transform: none;
  box-shadow: none;
}

.block-title {
  font-size: 16px;
  font-weight: bold;
  color: #2d3436;
  margin-bottom: 12px;
  text-align: center;
}

/* СТИЛИ ДЛЯ БЛОКА КУПОНОВ */
.coupons-block {
  height: 200px !important; /* ФИКСИРОВАННАЯ ВЫСОТА 200px !important */
  padding: 10px !important; /* УМЕНЬШАЕМ ПАДДИНГ !important */
  border-top: none !important; /* УБИРАЕМ ВЕРХНЮЮ ДЕКОРАТИВНУЮ ЛИНИЮ !important */
  flex-shrink: 1 !important; /* РАЗРЕШАЕМ СЖАТИЕ !important */
  min-height: 0 !important; /* УБИРАЕМ МИНИМАЛЬНУЮ ВЫСОТУ !important */
  box-sizing: border-box !important; /* ВАЖНО: учитываем padding в высоте */
}

.coupons-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px; /* УМЕНЬШАЕМ РАССТОЯНИЕ МЕЖДУ КУПОНАМИ */
  height: calc(100% - 5px) !important; /* 100% высоты блока минус небольшой отступ */
  overflow-y: auto;
  padding-right: 5px;
  box-sizing: border-box; /* ВАЖНО: учитываем padding в высоте */
}

/* ПРАВИЛЬНЫЙ РАСЧЁТ ВЫСОТЫ: блок 200px - небольшой отступ */
.coupons-container::-webkit-scrollbar {
  width: 4px;
}

.coupons-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.cupbg, .cupbg1 {
  flex: 0 0 calc(50% - 3px);
  display: flex;
  align-items: center;
  gap: 6px; /* УМЕНЬШАЕМ РАССТОЯНИЕ МЕЖДУ ЭЛЕМЕНТАМИ */
  padding: 6px; /* УМЕНЬШАЕМ ПАДДИНГ */
  border-radius: 6px; /* УМЕНЬШАЕМ РАДИУС */
  min-height: 34px; /* УМЕНЬШАЕМ МИНИМАЛЬНУЮ ВЫСОТУ */
  box-sizing: border-box;
}

.cupbg {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(240,240,240,0.9));
  border: 1px solid #dee2e6;
}

.cupbg1 {
  background: linear-gradient(135deg, rgba(152, 251, 152, 0.9), rgba(144, 238, 144, 0.9));
  border: 1px solid #90ee90;
}

.cupn {
  width: 22px; /* НЕМНОГО УМЕНЬШАЕМ РАЗМЕР */
  height: 22px; /* НЕМНОГО УМЕНЬШАЕМ РАЗМЕР */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 11px; /* УМЕНЬШАЕМ ШРИФТ */
  flex-shrink: 0;
}

.cupbg .cupn {
  background: linear-gradient(135deg, #636e72, #b2bec3);
  color: white;
}

.cupbg1 .cupn {
  background: linear-gradient(135deg, #00b894, #55efc4);
  color: white;
}

.cupnm {
  flex: 1;
  font-size: 10px; /* УМЕНЬШАЕМ ШРИФТ */
  color: #2d3436;
  line-height: 1.2;
  word-break: break-word;
}

.block-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.coupons-count, .cartridges-count {
  font-size: 24px;
  font-weight: bold;
  color: #0984e3;
}

.coupons-desc, .cartridges-desc {
  font-size: 12px;
  color: #636e72;
}

/* УБРАЛИ ОРАНЖЕВУЮ ЛИНИЮ */
.cartridges-block {
  /* border-top: 3px solid #e17055; УБРАЛИ */
}

/* СТИЛИ ДЛЯ ИЗОБРАЖЕНИЙ КАРТРИДЖЕЙ */
.cartridges-images-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    height: 80px;
    overflow-y: auto;
    padding-right: 5px;
    padding-top: 5px;
}

.cartridges-images-container::-webkit-scrollbar {
  width: 4px;
}

.cartridges-images-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.cartridges-images-container img {
  width: 76px;
  height: 53px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  background: white;
  padding: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
  cursor: help;
}

.cartridges-images-container img:hover {
  transform: scale(1.05);
  border-color: #0984e3;
}

.theme-container {
  display: flex;
  gap: 20px;
  height: 100%;
  min-height: 360px;
}

.theme-left-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 270px;
  height: 360px;
  padding-right: 5px;
}

.theme-left-column::-webkit-scrollbar {
  width: 4px;
}

.theme-left-column::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.theme-right-column {
    width: 280px;
    flex-shrink: 0;
    height: 360px;
    overflow: hidden;
}

.theme-block {
  background: rgba(248, 249, 250, 0.95);
  border-radius: 12px;
  border: 1px solid #dee2e6;
  overflow: hidden;
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.theme-block.icons-block {
    height: 60px;
    flex: 0 0 auto;
}

.theme-block.backgrounds-block {
    height: 100px;
    flex: 0 0 auto;
}

.theme-block.badges-block {
    height: 100px;
    flex: 0 0 auto;
}

.theme-block-content {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  height: 100%;
}

.scrollable-container {
  overflow-y: auto;
  flex: 1;
  padding-right: 5px;
  min-height: 0;
}

.icons-scroll {
  height: 130px;
}

.backgrounds-scroll {
  height: 80px;
}

.badges-scroll {
  height: 80px;
}

.scrollable-container::-webkit-scrollbar {
  width: 4px;
}

.scrollable-container::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 2px;
}

.icons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.backgrounds-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.fitting-room {
  background: rgba(248, 249, 250, 0.95);
  border-radius: 12px;
  border: 1px solid #dee2e6;
  height: 100%;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(5px);
}

.fitting-room-content {
  flex: 1;
  padding: 15px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#preview-profile-container .preview-profile {
    width: 210px;
    top: 30px;
    left: 8%;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: Verdana, sans-serif;
    font-size: 11px;
    position: relative;
}

#preview-profile-container .preview-profile ul {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

#preview-profile-container .pa-fld3 {
  position: relative;
  width: 100%;
  height: 35px;
  margin-bottom: 20px;
}

#preview-profile-container .pa-fld3 img {
    width: 100%;
    height: 42px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

#preview-profile-container #icprof {
    position: absolute;
    top: 20px;
    left: 7%;
    transform: translateX(-50%);
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#preview-profile-container #icprof img {
  width: 17px;
  height: 17px;
  padding: 5px;
  object-fit: contain;
}

#preview-profile-container .pa-author {
    text-align: center;
    top: -20px;
}

#preview-profile-container .pa-author a {
  color: #333;
  font-weight: bold;
  text-decoration: none;
}

#preview-profile-container .pa-title {
    text-align: center;
    font-style: italic;
    color: #666;
    min-height: 10px;
    margin-top: -25px;
}

#preview-profile-container .pa-avatar {
    text-align: center;
}

#preview-profile-container .pa-avatar img {
  max-width: 180px;
  max-height: 180px;
  border-radius: 5px;
}

#preview-profile-container .pa-fld4 {
    border-radius: 10px;
    padding: 10px;
    margin: 0 0 10px 0;
    font-size: 8px;
    line-height: 1.4;
    text-align: center;
    font-style: italic;
    color: #555;
}

#preview-profile-container .pa-fld4 .lz {
  width: 100%;
}

#preview-profile-container .pa-fld4 .ank {
  text-decoration: none;
  color: #555;
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}

#preview-profile-container .pa-fld4 .font-style {
  border-radius: 180px;
  padding: 2px 12px;
  line-height: 20px;
  display: inline-block;
  margin: 2px 0;
}

#preview-profile-container .pa-fld2 {
    margin-top: -20px;
    text-align: center;
}

#preview-profile-container .pa-fld2 img {
    width: 100%;
    height: 41px;
    object-fit: cover;
    border-radius: 0 0 10px 10px;
}

.pa-fld3, .pa-fld2 {
  transition: all 0.3s ease;
}

.achievements-container {
  display: flex;
  gap: 10px;
  height: 320px;
  width: 100%;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.achievements-container::-webkit-scrollbar {
  height: 5px;
}

.achievements-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.achievement-branch {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(248, 249, 250, 0.95);
  border-radius: 12px;
  border: 1px solid #dee2e6;
  backdrop-filter: blur(5px);
  position: relative;
}

.achievement-branch::before {
  content: '';
  position: absolute;
  top: 60px;
  bottom: 10px;
  width: 4px;
  background: linear-gradient(to top, #74b9ff, #0984e3);
  border-radius: 2px;
  z-index: 1;
}

.branch-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 2;
  background: white;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.branch-icon {
  font-size: 20px;
}

.branch-title {
  font-size: 12px;
  font-weight: bold;
  color: #2d3436;
  text-align: center;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.branch-nodes {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 15px;
  flex: 1;
  width: 100%;
  padding-top: 10px;
  z-index: 2;
}

.achievement-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.achievement-node:hover {
  transform: translateY(-3px);
}

.achievement-node .node-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  position: relative;
}

.achievement-node.unlocked .node-circle {
  background: linear-gradient(135deg, #00b894, #55efc4);
}

.achievement-node.locked .node-circle {
  background: linear-gradient(135deg, #636e72, #b2bec3);
  opacity: 0.8;
}

.achievement-node .node-circle::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.achievement-node.unlocked .node-circle::after {
  border-color: #00b894;
}

.achievement-node:hover .node-circle::after {
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
}

.achievement-node .node-icon {
  font-size: 20px;
}

.achievement-node .node-name {
  font-size: 12px;
  color: #2d3436;
  font-weight: 500;
  text-align: center;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: white;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* УБИРАЕМ ВЕРТИКАЛЬНУЮ ПРОКРУТКУ ДЛЯ ВСЕХ ЭЛЕМЕНТОВ */
.content-area::-webkit-scrollbar {
  display: none;
}

.content-area {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* СТИЛИ ДЛЯ ВКЛАДКИ "ФОНЫ" С ИНСТРУКЦИЕЙ */
.backgrounds-instruction {
  background: rgba(248, 249, 250, 0.95);
  border-radius: 12px;
  border: 1px solid #dee2e6;
  padding: 12px 15px;
  margin-bottom: 15px;
  backdrop-filter: blur(5px);
  text-align: center;
}

.instruction-text {
  font-size: 13px;
  color: #2d3436;
  line-height: 1.4;
  font-weight: 500;
}

/* ОБНОВЛЕННЫЕ СТИЛИ ДЛЯ ПРОСТОЙ ВКЛАДКИ "ФОНЫ" */
.backgrounds-simple-container {
  height: 270px; /* УВЕЛИЧИЛИ ДО 270px */
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 10px;
  align-items: center;
  scroll-behavior: smooth;
  overflow-y: hidden; /* УБИРАЕМ ВЕРТИКАЛЬНУЮ ПРОКРУТКУ */
}

.backgrounds-simple-container::-webkit-scrollbar {
  height: 6px;
}

.backgrounds-simple-container::-webkit-scrollbar-thumb {
  background: #0984e3;
  border-radius: 3px;
}

.backgrounds-simple-container::-webkit-scrollbar-track {
  background: rgba(9, 132, 227, 0.1);
  border-radius: 3px;
}

.background-image {
  flex: 0 0 auto;
  width: 100px;
  height: 260px; /* УВЕЛИЧИЛИ ДО 260px */
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.background-image:hover {
  transform: scale(1.05);
}

/* ИСПРАВЛЕННЫЕ СТИЛИ ДЛЯ ВЫДЕЛЕНИЯ ИКОНОК */
.icons-grid img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  padding: 5px;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
}

.icons-grid img.selected {
  background: rgba(9, 132, 227, 0.2);
  border: 2px solid #0984e3;
  border-radius: 5px;
  padding: 3px;
  transform: scale(0.95);
}

/* ИСПРАВЛЕННЫЕ СТИЛИ ДЛЯ ВЫДЕЛЕНИЯ ФОНОВ */
.backgrounds-grid img {
  width: 165px;
  height: 38px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.backgrounds-grid img.selected {
  border: 2px solid #0984e3;
  box-shadow: 0 0 0 2px rgba(9, 132, 227, 0.2);
  transform: scale(0.95);
  width: 160px;
  height: 36px;
}

/* ИСПРАВЛЕННЫЕ СТИЛИ ДЛЯ ВЫДЕЛЕНИЯ ПЛАШЕК */
.badges-grid img {
  width: 165px;
  height: 37px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.badges-grid img.selected {
  border: 2px solid #0984e3;
  box-shadow: 0 0 0 2px rgba(9, 132, 227, 0.2);
  transform: scale(0.95);
  width: 160px;
  height: 35px;
}

@media (max-width: 768px) {
  .phone-case {
    width: 95%;
    padding: 10px;
  }
  
  .phone-screen {
    height: 450px;
  }
  
  .side-tabs {
    width: 60px;
    padding: 10px 0;
  }
  
  .tab-button {
    width: 50px;
    height: 50px;
  }
  
  .tab-icon {
    font-size: 18px;
  }
  
  .tab-text {
    font-size: 10px;
  }
  
  .content-area {
    padding: 15px;
  }
  
  .home-container {
    flex-direction: column;
    max-height: 400px;
    min-height: 400px;
    gap: 15px;
  }
  
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .profile-buttons {
    flex-direction: column;
  }
  
  .profile-btn {
    width: 100%;
  }
  
  .right-column {
    display: none;
  }
  
  .theme-container {
    flex-direction: column;
    gap: 15px;
    min-height: 400px;
  }
  
  .theme-left-column {
    max-height: 320px;
    min-width: auto;
  }
  
  .theme-right-column {
    width: 100%;
    min-width: auto;
    height: auto;
  }
  
  .theme-block.icons-block {
    min-height: 130px;
  }
  
  .theme-block.backgrounds-block {
    min-height: 90px;
  }
  
  .theme-block.badges-block {
    min-height: 90px;
  }
  
  .icons-scroll {
    height: 110px;
  }
  
  .backgrounds-scroll {
    height: 70px;
  }
  
  .badges-scroll {
    height: 70px;
  }
  
  #preview-profile-container .pa-avatar img {
    max-width: 150px;
    max-height: 150px;
  }
  
  .achievements-container {
    height: 300px;
  }
  
  .achievement-branch {
    min-width: 110px;
  }
  
  .achievement-node .node-circle {
    width: 45px;
    height: 45px;
  }
  
  .achievement-node .node-icon {
    font-size: 18px;
  }
  
  .achievement-node .node-name {
    font-size: 11px;
    max-width: 90px;
  }
  
  .branch-title {
    font-size: 11px;
    max-width: 90px;
  }
  
  /* Адаптация для кнопки редактирования */
  .tab-button.edit-button {
    margin-top: 20px;
    margin-bottom: 5px;
  }
  
  /* Адаптация для вкладки "Фоны" */
  .backgrounds-instruction {
    padding: 10px 12px;
    margin-bottom: 12px;
  }
  
  .instruction-text {
    font-size: 12px;
  }
  
  .backgrounds-simple-container {
    height: 240px; /* Адаптивная высота для планшетов */
  }
  
  .background-image {
    width: 90px;
    height: 230px; /* Адаптивная высота картинок */
  }
  
  /* Адаптация для купонов */
  .coupons-block {
    height: 180px !important;
    padding: 8px !important;
  }
  
  .coupons-container {
    height: calc(100% - 5px) !important; /* Тот же отступ 5px */
  }
  
  .cupbg, .cupbg1 {
    flex: 0 0 100%;
    font-size: 10px;
  }
  
  .cupn {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  
  .cupnm {
    font-size: 9px;
  }
  
  /* Адаптация для картриджей */
  .cartridges-images-container {
    height: 110px;
  }
  
  .cartridges-images-container img {
    width: 70px;
    height: 49px;
  }
  
  /* Адаптация для выделения на мобильных */
  .icons-grid img {
    width: 16px;
    height: 16px;
  }
  
  .backgrounds-grid img {
    width: 155px;
    height: 36px;
  }
  
  .backgrounds-grid img.selected {
    width: 150px;
    height: 34px;
  }
  
  .badges-grid img {
    width: 155px;
    height: 35px;
  }
  
  .badges-grid img.selected {
    width: 150px;
    height: 33px;
  }
}

@media (max-width: 480px) {
  .phone-screen {
    height: 500px;
  }
  
  .side-tabs {
    width: 50px;
  }
  
  .tab-button {
    width: 45px;
    height: 45px;
  }
  
  .avatar {
    width: 80px;
    height: 80px;
  }
  
  .profile-name {
    font-size: 14px;
  }
  
  .profile-activity {
    font-size: 11px;
  }
  
  .theme-left-column {
    max-height: 280px;
  }
  
  .theme-block.icons-block {
    min-height: 120px;
  }
  
  .theme-block.backgrounds-block {
    min-height: 80px;
  }
  
  .theme-block.badges-block {
    min-height: 80px;
  }
  
  .icons-scroll {
    height: 100px;
  }
  
  .backgrounds-scroll {
    height: 60px;
  }
  
  .badges-scroll {
    height: 60px;
  }
  
  #preview-profile-container .preview-profile {
    padding: 8px;
  }
  
  #preview-profile-container .pa-avatar img {
    max-width: 120px;
    max-height: 120px;
  }
  
  .achievements-container {
    height: 280px;
  }
  
  .achievement-branch {
    min-width: 100px;
  }
  
  .achievement-node .node-circle {
    width: 40px;
    height: 40px;
  }
  
  .achievement-node .node-icon {
    font-size: 16px;
  }
  
  .achievement-node .node-name {
    font-size: 10px;
    max-width: 80px;
  }
  
  .branch-title {
    font-size: 10px;
    max-width: 80px;
  }
  
  /* Адаптация для кнопки редактирования */
  .tab-button.edit-button {
    margin-top: 15px;
    margin-bottom: 5px;
  }
  
  /* Адаптация для вкладки "Фоны" */
  .backgrounds-instruction {
    padding: 8px 10px;
    margin-bottom: 10px;
  }
  
  .instruction-text {
    font-size: 11px;
  }
  
  .backgrounds-simple-container {
    height: 220px; /* Адаптивная высота для мобильных */
  }
  
  .background-image {
    width: 80px;
    height: 210px; /* Адаптивная высота картинок */
  }
  
  /* Адаптация для купонов */
  .coupons-block {
    height: 160px !important;
    padding: 6px !important;
  }
  
  .coupons-container {
    height: calc(100% - 5px) !important; /* Тот же отступ 5px */
  }
  
  .cupbg, .cupbg1 {
    padding: 5px;
    min-height: 32px;
  }
  
  .cupn {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }
  
  .cupnm {
    font-size: 8px;
  }
  
  /* Адаптация для картриджей */
  .cartridges-images-container {
    height: 100px;
    gap: 6px;
  }
  
  .cartridges-images-container img {
    width: 65px;
    height: 45px;
  }
  
  /* Адаптация для выделения на мобильных */
  .icons-grid img {
    width: 15px;
    height: 15px;
  }
  
  .backgrounds-grid img {
    width: 145px;
    height: 34px;
  }
  
  .backgrounds-grid img.selected {
    width: 140px;
    height: 32px;
  }
  
  .badges-grid img {
    width: 145px;
    height: 33px;
  }
  
  .badges-grid img.selected {
    width: 140px;
    height: 31px;
  }
}

@media (max-width: 380px) {
  .achievements-container {
    gap: 8px;
  }
  
  .achievement-branch {
    min-width: 90px;
    padding: 8px;
  }
  
  .achievement-node .node-circle {
    width: 35px;
    height: 35px;
  }
  
  .achievement-node .node-icon {
    font-size: 14px;
  }
  
  .achievement-node .node-name {
    font-size: 9px;
    max-width: 70px;
  }
  
  .branch-title {
    font-size: 9px;
    max-width: 70px;
  }
  
  /* Адаптация для кнопки редактирования */
  .tab-button.edit-button {
    margin-top: 10px;
    margin-bottom: 5px;
    width: 40px;
    height: 40px;
  }
  
  /* Адаптация для вкладки "Фоны" */
  .backgrounds-instruction {
    padding: 6px 8px;
    margin-bottom: 8px;
  }
  
  .instruction-text {
    font-size: 10px;
  }
  
  .backgrounds-simple-container {
    height: 200px; /* Адаптивная высота для маленьких экранов */
  }
  
  .background-image {
    width: 70px;
    height: 190px; /* Адаптивная высота картинок */
  }
  
  /* Адаптация для купонов */
  .coupons-block {
    height: 140px !important;
    padding: 4px !important;
  }
  
  .coupons-container {
    height: calc(100% - 5px) !important; /* Тот же отступ 5px */
  }
  
  .cupbg, .cupbg1 {
    flex: 0 0 100%;
    padding: 4px;
  }
  
  .cupn {
    width: 16px;
    height: 16px;
    font-size: 8px;
  }
  
  .cupnm {
    font-size: 7px;
  }
  
  /* Адаптация для картриджей */
  .cartridges-images-container {
    height: 90px;
    gap: 5px;
  }
  
  .cartridges-images-container img {
    width: 60px;
    height: 42px;
  }
  
  /* Адаптация для выделения на мобильных */
  .icons-grid img {
    width: 14px;
    height: 14px;
  }
  
  .backgrounds-grid img {
    width: 135px;
    height: 32px;
  }
  
  .backgrounds-grid img.selected {
    width: 130px;
    height: 30px;
  }
  
  .badges-grid img {
    width: 135px;
    height: 31px;
  }
  
  .badges-grid img.selected {
    width: 130px;
    height: 29px;
  }
}