@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap");

* {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(120deg, #1e1e20, #2b2b2d);
  color: #fff;
}

/* Убираем фиксированную высоту, чтобы всё скроллилось натурально */
.main-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Шапка */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(6px);
}
.header-title {
  font-size: 1.2rem;
  font-weight: 600;
}
.gear-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #fff;
  font-size: 1.1rem;
  padding: 6px;
  border-radius: 4px;
  transition: background 0.3s;
}
.gear-btn:hover {
  background: rgba(255,255,255,0.1);
}

/* Сетка иконок */
.icons-container {
  display: grid;
  gap: 10px;
  padding: 10px;
  grid-template-columns: repeat(2, 1fr);
}

/* От 480px до 768px - 3 колонки */
@media (min-width: 480px) and (max-width: 768px) {
  .icons-container {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* 769px до 1200px - 4 колонки */
@media (min-width: 769px) and (max-width: 1200px) {
  .icons-container {
    grid-template-columns: repeat(4, 1fr);
  }
}
/* Более 1200px - 5 колонки */
@media (min-width: 1201px) {
  .icons-container {
    grid-template-columns: repeat(5, 1fr);
  }
}

.icon-div {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 80px;
  cursor: pointer;
  border-radius: 8px;
  color: #fff;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  padding: 6px;
  overflow: hidden;
}
.icon-div:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255,255,255,0.2);
}
.icon-div span {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Кнопки */
.button-custom {
  color: #fff;
  background: linear-gradient(135deg, #0054ff, #2e7fff);
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.3s;
  font-size: 0.9rem;
  margin-top: 4px;
  white-space: nowrap;
}
.button-custom:hover {
  background: linear-gradient(135deg, #2e7fff, #0054ff);
}

/* Страница iframe */
.iframe-screen {
  display: none;
  flex-direction: column;
  height: 100vh;
  background: linear-gradient(120deg, #1e1e20, #2b2b2d);
}
.iframe-header {
  display: flex;
  align-items: center;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(6px);
}
.iframe-back-button {
  color: #fff;
  border: none;
  background: linear-gradient(135deg, #0054ff, #2e7fff);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.3s;
  font-size: 0.9rem;
}
.iframe-back-button:hover {
  background: linear-gradient(135deg, #2e7fff, #0054ff);
}
.iframe-content {
  flex: 1;
  border: none;
  width: 100%;
}

/* Модальное окно */
.modal-backdrop {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100vw; 
  height: 100vh;
  background: #000;
  opacity: 0;
  z-index: 999998;
  transition: opacity 0.25s;
  pointer-events: none;
}
.modal-backdrop.show {
  opacity: 0.7;
  pointer-events: auto;
}
.modal {
  position: fixed;
  z-index: 999999;
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 280px;
  max-width: 90%;
  background: linear-gradient(120deg, #2a2a2c, #3b3b3d);
  border-radius: 8px;
  padding: 16px;
  color: #fff;
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  pointer-events: none;
}
.modal.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.modal-header {
  font-weight: 600;
  margin-bottom: 8px;
}
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.modal-form label {
  font-size: 0.85rem;
  opacity: 0.8;
}
.modal-form input {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.85rem;
}
.modal-form input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
