/* ============================================================
   ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ СТРАНИЦ
   ============================================================ */

/* --- СБРОС И БАЗА --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: #000;
  color: #fff;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding: 0;
}

/* --- ФОН (переменная --bg-scale для динамического размера) --- */
.background-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('background.png');
  background-repeat: repeat-x;
  background-position: center top;
  z-index: -1;
  background-size: var(--bg-scale, 100%) auto;
}

/* На мобильных — cover, чтобы не было пустот */
@media (max-width: 768px) {
  .background-image {
    background-size: cover;
    background-repeat: no-repeat;
  }
}

/* --- КОНТЕЙНЕРЫ --- */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(12px, 4vw, 20px);
}

/* Основной блок для центрирования на весь экран (main.php) */
.page-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  min-height: 100vh;
  padding-top: clamp(40px, 15vh, 84px);
  padding-bottom: clamp(40px, 10vh, 84px);
  padding-left: 16px;
  padding-right: 16px;
}

/* Блок для формы авторизации (index.php) */
.auth-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 450px;
  margin: 0 auto;
  padding-top: 18px;
}

/* --- ШАПКА --- */
.header {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  padding: clamp(15px, 4vw, 20px);
  margin-bottom: clamp(20px, 5vw, 30px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  backdrop-filter: blur(3px);
}

/* Основной блок контента */
.content {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  padding: clamp(20px, 5vw, 40px);
  backdrop-filter: blur(3px);
}

/* --- ТИПОГРАФИКА --- */
.welcome {
  font-size: clamp(18px, 5vw, 24px);
  font-weight: bold;
  color: #ffffff;
  word-break: break-word;
}

.page-title {
  font-size: clamp(24px, 6vw, 36px);
  margin-bottom: clamp(20px, 5vw, 30px);
  color: #ffffff;
  text-align: center;
  word-break: break-word;
}

/* --- КНОПКИ --- */
.btn {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 10px 20px;
  font-size: clamp(14px, 3.5vw, 16px);
  min-height: 44px;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Маленькая кнопка (для строки с балансом в donate) */
.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
  height: 30px;
  min-height: unset;
}

/* Золотая кнопка (пополнить и т.п.) */
.btn-gold {
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
}

.btn-gold:hover {
  background: rgba(255, 215, 0, 0.4);
  color: #fff;
}

/* Зелёная кнопка */
.btn-green {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.25);
  color: #4caf50;
}

.btn-green:hover {
  background: #4caf50;
  color: #fff;
}

/* --- БАЛАНС --- */
.balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 215, 0, 0.2);
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 8px;
  padding: 8px 15px;
  font-weight: bold;
  font-size: clamp(14px, 4vw, 18px);
}

/* Компактный баланс в шапке (для donate и operations) */
.header .balance {
  font-size: 14px;
  padding: 4px 10px;
  height: 30px;
  border-radius: 8px;   /* унифицируем с кнопками */
}

/* По желанию – такой же размер для баланса внутри .user-info, если он обёрнут */
.user-info .balance {
  font-size: 14px;
  padding: 4px 10px;
  height: 30px;
  border-radius: 8px;
}

.balance span {
  color: #ffd700;
  font-size: inherit;
}

/* Компактный баланс (для donate, если нужно) */
.balance-sm {
  font-size: 14px;
  padding: 4px 10px;
  height: 30px;
}

/* --- СЕТКА ДЛЯ СЕРВЕРОВ / КАРТОЧЕК --- */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.server-card {
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.server-card:hover {
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-5px);
  background: rgba(0, 0, 0, 0.8);
}

.server-card.selected {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.server-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.server-name {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 5px;
}

.server-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* --- ТАБЫ --- */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 10px 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  border-radius: 8px;
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* --- КАРТОЧКИ ПРИВИЛЕГИЙ И ТОВАРОВ --- */
.privileges-grid,
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.privilege-card,
.product-card {
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 12px 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
}

.privilege-card:hover,
.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.8);
}

.privilege-card.disabled,
.product-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.privilege-card.disabled:hover,
.product-card.disabled:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.3);
}

.privilege-name,
.product-name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 6px;
}

.privilege-price,
.product-price {
  font-size: 20px;
  font-weight: bold;
  color: #ffd700;
  margin: 6px 0;
}

.product-description {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.privilege-status,
.product-status {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 8px;
}

.status-extend {
  background: rgba(33, 150, 243, 0.3);
  color: #2196f3;
  border: 1px solid #2196f3;
}

.status-unavailable {
  background: rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
  border: 1px solid #ff6b6b;
}

.status-available {
  background: rgba(255, 215, 0, 0.3);
  color: #ffd700;
  border: 1px solid #ffd700;
}

/* --- АКТИВНЫЕ ПРИВИЛЕГИИ --- */
.active-privileges {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.active-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #ffd700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.active-item {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.active-item .priv-name {
  font-weight: bold;
  color: #ffd700;
}

.active-item .days-left {
  color: #4caf50;
}

/* --- МОДАЛЬНОЕ ОКНО --- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.modal.show {
  display: flex;
}

.modal-content {
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-content h3 {
  font-size: 24px;
  margin-bottom: 10px;
}

.modal-content .item-name-modal {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}

.modal-content .price-modal {
  font-size: 32px;
  font-weight: bold;
  color: #ffd700;
  margin: 15px 0;
}

.quantity-input {
  margin: 20px 0;
}

.quantity-input label {
  display: block;
  margin-bottom: 10px;
  font-size: 16px;
}

.quantity-input input {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 7px;
  color: #fff;
  font-size: 18px;
  text-align: center;
}

.total-price {
  font-size: 18px;
  margin: 15px 0;
  padding: 10px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 8px;
}

.total-price span {
  font-size: 24px;
  font-weight: bold;
  color: #ffd700;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 7px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.3s ease;
}

.modal-btn.buy {
  background: rgba(76, 175, 80, 0.3);
  border-color: #4caf50;
}

.modal-btn.buy:hover {
  background: rgba(76, 175, 80, 0.8);
}

.modal-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.2);
}

.no-selection {
  text-align: center;
  padding: 40px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
}

/* --- СООБЩЕНИЯ --- */
.message {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid #4caf50;
  color: #4caf50;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.error-message {
  background: rgba(255, 107, 107, 0.2);
  border: 1px solid #ff6b6b;
  color: #ff6b6b;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

/* --- ИСТОРИЯ ОПЕРАЦИЙ --- */
.operations-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.operation-item {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  padding: 15px 20px;
  transition: all 0.3s ease;
  border-left: 4px solid;
}

.operation-item:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateX(5px);
}

.operation-item.debit { border-left-color: #ff6b6b; }
.operation-item.credit { border-left-color: #4caf50; }
.operation-item.transfer { border-left-color: #ff9800; }
.operation-item.processing { border-left-color: #2196f3; }
.operation-item.error { border-left-color: #ff9800; }

.operation-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.operation-type {
  font-size: 18px;
  font-weight: bold;
}

.operation-date {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.operation-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
  word-break: break-word;
}

.operation-details {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
}

.operation-amount {
  font-weight: bold;
}

.operation-amount.debit { color: #ff6b6b; }
.operation-amount.credit { color: #4caf50; }

.operation-balance {
  color: #ffd700;
}

/* --- ПАГИНАЦИЯ --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.page-link {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 8px 15px;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
  min-width: 40px;
  text-align: center;
}

.page-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

.page-link.active {
  background: rgba(255, 255, 255, 0.3);
  border-color: #ffd700;
}

.page-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.no-operations {
  text-align: center;
  padding: 40px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
}

/* Инфо-панель (кол-во операций) */
.info-panel {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 25px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.info-item {
  font-size: 14px;
}

.info-label {
  color: rgba(255, 255, 255, 0.6);
}

.info-value {
  font-weight: bold;
  color: #ffd700;
}

/* --- СТРАНИЦА ПРАВИЛ --- */
.sidebar {
  width: 250px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  padding: clamp(15px, 4vw, 20px);
  backdrop-filter: blur(3px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-size: clamp(18px, 4.5vw, 20px);
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
  color: #ffffff;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-menu a {
  display: block;
  padding: 12px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
  white-space: nowrap;
}

.sidebar-menu a.active {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  border-color: #fff;
}

.rules-wrapper {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  padding: 5px 15px;
}

.rules-text {
  line-height: 1.3;
  font-size: clamp(13px, 3.5vw, 14px);
  text-align: justify;
  word-break: break-word;
}

.rule-line {
  margin-bottom: 4px;
}

.rule-title {
  font-weight: bold;
  font-size: clamp(14px, 3.8vw, 15px);
  margin: 10px 0 4px 0;
  color: #fff;
}

.punishment {
  background: rgba(255, 0, 0, 0.1);
  border-left: 3px solid #ff4444;
  padding: 4px 8px;
  margin: 3px 0 8px 0;
  border-radius: 0 5px 5px 0;
  font-weight: bold;
  font-size: clamp(12px, 3.2vw, 13px);
}

.empty-line {
  height: 1.3em;
}

/* Пагинация для правил (крупные кнопки) */
.pagination-simple {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  gap: 20px;
}

.pagination-btn {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
  padding: 12px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: clamp(14px, 3.5vw, 16px);
  transition: all 0.3s ease;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  min-width: 100px;
}

.pagination-btn:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.96);
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.3);
}

.pagination-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.page-info {
  font-size: clamp(14px, 3.5vw, 16px);
  color: #fff;
  text-align: center;
  white-space: nowrap;
}

/* --- СТРАНИЦА ГОЛОСОВАНИЙ --- */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(15px, 3vw, 25px);
  margin-bottom: 20px;
}

.chart-card {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: clamp(10px, 2.5vw, 15px);
  backdrop-filter: blur(3px);
  transition: transform 0.2s;
}

.chart-card:hover {
  transform: translateY(-2px);
}

.chart-title {
  font-size: clamp(14px, 3.5vw, 18px);
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
}

.chart-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: clamp(10px, 2.5vw, 15px);
  font-size: clamp(10px, 2.5vw, 12px);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 280px;
}

canvas {
  max-width: 100%;
  height: auto;
  max-height: 280px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 6px;
  text-align: center;
}

.stat-day {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 14px;
  font-weight: bold;
  color: #4dc0ff;
}

.total-votes {
  background: rgba(77, 192, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
}

.total-votes span {
  color: #4dc0ff;
  font-weight: bold;
}

.note {
  text-align: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.no-data {
  text-align: center;
  padding: 30px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

/* --- СМЕНА СКИНА --- */
.skin-upload-container {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 5vw, 40px);
  justify-content: center;
  align-items: flex-start;
}

.upload-form {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: clamp(20px, 5vw, 30px);
  min-width: 260px;
  flex: 1;
  max-width: 400px;
}

.form-title {
  font-size: clamp(18px, 4.5vw, 20px);
  margin-bottom: 20px;
  text-align: center;
  color: #fff;
}

.form-group {
  margin-bottom: 20px;
}

.file-input {
  width: 100%;
  padding: clamp(10px, 3vw, 12px);
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  color: #fff;
  font-size: clamp(13px, 3.5vw, 16px);
  margin-bottom: 15px;
  cursor: pointer;
}

.file-input::-webkit-file-upload-button {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  padding: 5px 10px;
  margin-right: 10px;
}

.upload-btn {
  width: 100%;
  padding: clamp(10px, 3vw, 12px);
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: clamp(14px, 3.5vw, 16px);
  transition: all 0.3s ease;
  min-height: 44px;
}

.upload-btn:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.98);
}

.upload-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.preview-container {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: clamp(20px, 5vw, 30px);
  text-align: center;
  flex: 1;
  max-width: 500px;
}

.preview-title {
  font-size: clamp(18px, 4.5vw, 20px);
  margin-bottom: 20px;
  color: #fff;
}

#mainCanvas {
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  background: transparent;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.result-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  font-size: clamp(12px, 3vw, 14px);
}

.result-message.success {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid #4CAF50;
  color: #fff;
}

.result-message.error {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid #F44336;
  color: #fff;
}

.result-message.info {
  background: rgba(33, 150, 243, 0.2);
  border: 1px solid #2196F3;
  color: #fff;
}

.requirements {
  margin-top: 20px;
  padding: clamp(12px, 3vw, 15px);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.requirements h4 {
  margin-bottom: 10px;
  color: #fff;
  font-size: clamp(14px, 3.5vw, 16px);
}

.requirements ul {
  list-style-position: inside;
  color: rgba(255, 255, 255, 0.8);
  padding-left: 0;
}

.requirements li {
  margin-bottom: 5px;
  font-size: clamp(12px, 3vw, 14px);
}

#myDiv {
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

#noSkinMessage {
  display: none;
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(13px, 3.5vw, 14px);
}

/* --- АВТОРИЗАЦИЯ (index.php) --- */
.auth-container {
  background: transparent;
  width: 100%;
  max-width: 360px;
  overflow: hidden;
  backdrop-filter: blur(3px);
}

.tab-buttons {
  display: flex;
}

.tab-button {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  padding: 10.8px 18px;
  cursor: pointer;
  color: #fff;
  flex: 1;
  text-align: center;
  font-size: clamp(12.6px, 2.25vw, 14.4px);
  transition: all 0.3s ease;
  /* Убираем нижнюю границу по умолчанию? Нет, только у активной */
}

.tab-button.active {
  border-bottom: none;               /* <-- вот ключевое */
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.tab-button:first-child {
  border-top-left-radius: 9px;
  border-right: 1px solid rgba(255, 255, 255, 0.8);
}

.tab-button:last-child {
  border-top-right-radius: 9px;
  border-left: 1px solid rgba(255, 255, 255, 0.8);
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Убираем зазоры и лишнюю рамку у табов внутри формы авторизации */
.auth-container .tabs {
  gap: 0;
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.form-container {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-top: none;
  border-radius: 0 0 16px 16px;
  padding: clamp(13.5px, 2.7vw, 22.5px);
}

.form-group label {
  display: block;
  margin-bottom: 7.2px;
  color: #fff;
  font-weight: bold;
  font-size: clamp(12.6px, 2.25vw, 14.4px);
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: clamp(9px, 1.8vw, 10.8px);
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 7px;
  color: #fff;
  font-size: clamp(12.6px, 2.25vw, 14.4px);
  transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-size: clamp(10.8px, 1.8vw, 12.6px);
}

.submit-button {
  width: 100%;
  padding: clamp(9px, 1.8vw, 10.8px);
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 7px;
  cursor: pointer;
  font-weight: bold;
  font-size: clamp(12.6px, 2.25vw, 14.4px);
  transition: all 0.3s ease;
}

.submit-button:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
}

.error {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  padding: 10.8px;
  border-radius: 7px;
  margin-top: 13.5px;
  border: 1px solid #ff6b6b;
  text-align: center;
  font-size: clamp(10.8px, 1.8vw, 12.6px);
}

.rules-layout {
  display: flex;
  gap: 20px;
  align-items: stretch;
  min-height: 600px;
}

.rules-checkbox {
  margin: 13.5px 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.rules-checkbox input[type="checkbox"] {
  margin-top: 1.8px;
  transform: scale(1.08);
}

.rules-checkbox label {
  margin-bottom: 0;
  font-weight: normal;
  line-height: 1.4;
  font-size: clamp(10.8px, 1.8vw, 12.6px);
}

.rules-link {
  color: #4dabf7;
  text-decoration: underline;
  cursor: pointer;
}

.rules-link:hover {
  color: #74c0fc;
}

#rules-content-container {
    display: flex;
    flex-direction: column;
    flex: 1;                  /* займёт всю высоту .content */
}

#rules-content-container .page-title {
    flex-shrink: 0;           /* заголовок не сжимается */
}

#rules-content-container .rules-wrapper {
    flex: 1;                  /* занимает всё доступное пространство */
    overflow: hidden;         /* без внутреннего скролла */
}

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-content .content {
    display: flex;
    flex-direction: column;
    height: 600px;        /* фиксированная высота подбирается под ваш контент */
    overflow: hidden;     /* ничего не вылезет наружу */
}

.main-content .pagination-simple {
    margin-top: auto;
}

.captcha-checkbox {
  height: 120px;
  text-align: center;
}

/* Кнопка "О нас" на главной */
.btn-about {
  display: inline-block;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  width: 90px;
  padding: 9px 0;
  text-align: center;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14.4px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 4px;
}

.btn-about:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  color: #fff;
}

/* --- ГЛАВНОЕ МЕНЮ (main.php) --- */
.logo-container {
  text-align: center;
  margin-bottom: 10px;
  width: 100%;
}

.logo {
  text-align: center;
  margin-bottom: 8px;
}
.logo img {
  display: block;
  max-width: min(100%, 300px);
  height: auto;
  max-height: 90px;
  width: auto;
  margin: 0 auto;
}

.buttons-container {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 3vw, 20px);
  flex-wrap: wrap;
  margin-top: 20px;
  width: 100%;
}

.menu-button,
.link-button {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
  padding: 17px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: clamp(14px, 3.5vw, 18px);
  font-weight: bold;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-width: clamp(140px, 30vw, 200px);
  height: 56px;
  white-space: nowrap;
}

.menu-button:hover,
.link-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-top: none;
  border-radius: 0 0 12px 12px;
  z-index: 1;
  backdrop-filter: blur(5px);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.4s ease 0.2s;
}

.dropdown-content.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-content a {
  display: block;
  padding: 12px 20px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  font-size: clamp(13px, 3vw, 16px);
}

.menu-button.squared {
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.server-status {
  position: fixed;
  bottom: clamp(60px, 10vh, 84px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: clamp(10px, 3vw, 15px);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: calc(100% - 32px);
  max-width: 400px;
  z-index: 1000;
  backdrop-filter: blur(3px);
  font-size: clamp(12px, 3vw, 14px);
}

.status-bar {
  height: 8px;
  border-radius: 4px;
  margin-top: 10px;
}

.online { color: #9bd2a8; }
.offline { color: #f77a85; }
.loading { color: #f7db88; }
.error { color: #f77a85; }

/* --- О НАС (about.php) --- */
.about-content {
  line-height: 1.6;
  font-size: clamp(14px, 3.5vw, 16px);
}

.about-content p {
  margin-bottom: 20px;
  text-align: justify;
}

.about-content a {
  color: #4dc0ff;
  text-decoration: none;
  font-weight: 500;
}

.banner {
  display: block;
  margin: 20px auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.contact-info {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: clamp(15px, 4vw, 20px);
  margin-top: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.contact-title {
  font-size: clamp(18px, 4.5vw, 20px);
  font-weight: bold;
  margin-bottom: 15px;
}

.contact-item {
  margin-bottom: 10px;
  padding-left: clamp(10px, 3vw, 20px);
  font-size: clamp(13px, 3.5vw, 15px);
}

.indent-1 { padding-left: clamp(20px, 5vw, 40px); }
.indent-2 { padding-left: clamp(30px, 8vw, 60px); }

/* --- АНИМАЦИИ --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.content, .header, .operation-item, .chart-card, .sidebar {
  animation: fadeIn 0.5s ease;
}

/* --- АДАПТИВ --- */
@media (max-width: 768px) {
  .header { flex-direction: column; text-align: center; }
  .servers-grid { grid-template-columns: 1fr; }
  .privileges-grid, .products-grid { grid-template-columns: 1fr; }
  .modal-buttons { flex-direction: column; }
  .tabs { justify-content: center; }
  .charts-row { grid-template-columns: 1fr; }
  .sidebar { width: 100%; order: 2; }
  .skin-upload-container { flex-direction: column; align-items: center; }
  .buttons-container { flex-direction: column; align-items: center; }
  .dropdown { width: 100%; max-width: 200px; }
  .menu-button, .link-button { width: 100%; }
  .pagination-simple { gap: 12px; }
  .pagination-btn { min-width: 80px; padding: 10px 16px; }
  .rules-layout { flex-direction: column; }
  .main-content { order: 1; }
}

@media (max-width: 480px) {
  .container { padding: 10px; }
  .content { padding: 15px; }
  .operation-item { padding: 12px 15px; }
  .page-info { font-size: 13px; white-space: normal; }
  .logo-container { margin-bottom: 4px; }
  .logo { max-height: 60px; }
  .btn-sm { font-size: 12px; padding: 4px 8px; }
}

/* --- 2FA --- */
.error-2fa {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  padding: 10px;
  border-radius: 7px;
  margin-bottom: 15px;
  border: 1px solid #ff6b6b;
  font-size: 12px;
}
/* Поле ввода 2FA кода */
.twofa-input {
  width: auto;
  max-width: 200px;
  margin: 0 auto 20px;
  display: block;
  font-size: 24px;
  letter-spacing: 8px;
  text-align: center;
  padding: 12px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 7px;
  color: #fff;
}
.twofa-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.9);
}

/* Кнопка подтверждения внутри модального окна */
.modal-content > .modal-btn {
  display: inline-block;
  width: auto;
  margin-top: 15px;
  padding: 12px 30px;
}

/* --- ЧАТ --- */
.chat-box {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.chat-message.user {
    background: rgba(33, 150, 243, 0.2);
    align-self: flex-end;
    border: 1px solid rgba(33, 150, 243, 0.5);
}

.chat-message.admin {
    background: rgba(76, 175, 80, 0.2);
    align-self: flex-start;
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.chat-author {
    font-weight: bold;
    margin-right: 8px;
    color: #ffd700;
    font-size: 12px;
}

.chat-time {
    display: block;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.chat-form {
    display: flex;
    gap: 6px;
}

.chat-input {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
}

.chat-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.9);
}

/* Треды в админке */
.chat-thread {
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.thread-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #fff;
}

.badge-open {
    background: #4caf50;
    color: #000;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
}

.chat-messages {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 8px;
}
.chat-messages .chat-message {
    align-self: flex-start;
    max-width: 90%;
}

.badge-closed {
    background: #9e9e9e;
    color: #000;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
}

.chat-actions {
    margin-top: 10px;
}
/* Кнопки блокировки/разблокировки – можно сделать меньше */
.chat-actions .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}
.badge-answered {
    background: #ff9800;
    color: #000;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
}
.info-message {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid #ff9800;
    color: #ff9800;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}
#logoCanvas {
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    width: 320px;
    height: auto;   /* сохраняет пропорции */
    aspect-ratio: 1 / 1; /* гарантирует квадрат */
    border: 1px solid rgba(255,255,255,0.3);
	max-width: none;
	max-height: none;
}
.color-btn {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255,255,255,0.4);
    cursor: pointer;
    border-radius: 4px;
    background-size: cover;
}
.color-btn.eraser {
    background-size: auto;
}
#logoCanvas,
#gridCanvas {
    max-width: none;
    max-height: none;
}
#gridCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 320px;
    height: 320px;
    pointer-events: none;
}