/* Основные стили */
body {
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  margin: 0;
  min-height: 100vh;
  box-sizing: border-box;
  line-height: 1.5;
  background-attachment: fixed;
  background-size: cover;
  -webkit-background-clip: border-box;
          background-clip: border-box;
}

.container {
  width: 100%;
  max-width: 1500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  gap: 16px;
  background-color: rgba(25, 25, 35, 0.8);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-background-clip: padding-box;
          background-clip: padding-box;
}

h1 {
  margin-bottom: 20px;
  color: #fff; /* Fallback для браузеров без поддержки */
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  text-align: center;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  background: linear-gradient(90deg, #64f0ff, #9080ff);
  -webkit-background-clip: text;
     -moz-background-clip: text;
          background-clip: text;
  color: transparent;
}

/* Верхняя секция */
.top-section {
  display: flex;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: stretch;
}

/* Блок информации */
.info-block {
  flex: 1;
  min-width: 280px;
  background: rgba(30, 30, 40, 0.7);
  border-radius: 12px;
  padding: 16px, 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  -webkit-background-clip: padding-box;
          background-clip: padding-box;
}

#status {
  font-size: clamp(15px, 2vw, 17px);
  padding: 12px 16px;
  background: rgba(40, 40, 50, 0.7);
  border-radius: 8px;
  text-align: center;
  margin-bottom: 16px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a0e0ff;
  -webkit-background-clip: padding-box;
          background-clip: padding-box;
}

.server-info {
  font-size: clamp(14px, 2vw, 16px);
  color: #d0d0d0;
  text-align: center;
  padding: 12px 0 0;
}

.server-info strong {
  color: #f0f0f0;
}

.server-version {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.server-connect {
  margin-top: 10px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Блок кнопок */
.control-buttons {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.buttons-row {
  display: flex;
  gap: 10px;
}

.buttons-row button {
  flex: 1;
  background: linear-gradient(135deg, rgba(60, 60, 80, 0.8), rgba(40, 40, 60, 0.8));
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 8px;
  font-size: clamp(14px, 2vw, 16px);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 0;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  -webkit-background-clip: padding-box;
     -moz-background-clip: padding-box;
          background-clip: padding-box;
}

.buttons-row button:hover {
  background: linear-gradient(135deg, rgba(80, 80, 100, 0.8), rgba(60, 60, 80, 0.8));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.buttons-row button:last-child {
  background: linear-gradient(135deg, rgba(150, 40, 40, 0.8), rgba(100, 20, 20, 0.8));
  border-color: rgba(255, 100, 100, 0.2);
}

.buttons-row button:last-child:hover {
  background: linear-gradient(135deg, rgba(180, 60, 60, 0.8), rgba(130, 40, 40, 0.8));
}

.download-button {
  width: 100%;
  background: linear-gradient(135deg, rgba(40, 100, 180, 0.8), rgba(20, 60, 130, 0.8));
  color: white;
  border: 1px solid rgba(100, 180, 255, 0.2);
  padding: 12px;
  font-size: clamp(14px, 2vw, 16px);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  -webkit-background-clip: padding-box;
     -moz-background-clip: padding-box;
          background-clip: padding-box;
}

.download-button:hover {
  background: linear-gradient(135deg, rgba(60, 130, 210, 0.8), rgba(40, 100, 180, 0.8));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.exit-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(120, 30, 30, 0.8), rgba(80, 10, 10, 0.8)) !important;
  color: white;
  border: 1px solid rgba(255, 60, 60, 0.3) !important;
  padding: 12px;
  font-size: clamp(14px, 2vw, 16px);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.exit-btn:hover {
  background: linear-gradient(135deg, rgba(160, 40, 40, 0.9), rgba(110, 20, 20, 0.9)) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
}

/* Логи и команды */

/* Обновленные стили для контейнера логов */
.log-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 15px;
  position: relative; /* Добавляем относительное позиционирование */
}

.log-content-wrapper {
  position: relative;
  width: 100%;
  height: 50vh;
  overflow: auto;
  background: rgba(10, 10, 15, 0.9);
  box-sizing: border-box;
  padding: 12px;
  padding-bottom: 50px;
}

/* Стили для WebKit (Chrome, Safari, Edge) */
.log-content-wrapper::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.log-content-wrapper::-webkit-scrollbar-track {
  background: rgba(30, 30, 40, 0.5);
  border-radius: 5px;
}

.log-content-wrapper::-webkit-scrollbar-thumb {
  background: rgba(80, 80, 100, 0.7);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.log-content-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 100, 120, 0.9);
}

.log-content-wrapper::-webkit-scrollbar-corner {
  background: transparent;
}

#log-box {
  display: block;
  white-space: pre;
  word-break: break-word;
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  color: #a0ffa0;
  text-shadow: 0 0 5px rgba(100, 255, 100, 0.3);
  min-width: 100%;
}

/* Кнопка прокрутки вниз */
.scroll-down-btn {
  position: absolute; /* Абсолютное позиционирование относительно .log-container */
  bottom: 100px;
  right: 25px;
  width: 36px;
  height: 36px;
  background: rgba(80, 80, 100, 0.7);
  border-radius: 50%;
  border: none;
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.log-content-wrapper:hover .scroll-down-btn {
  opacity: 1;
  pointer-events: auto;
}

.scroll-down-btn:hover {
  background: rgba(120, 120, 140, 0.95);
  transform: scale(1.1);
  opacity: 1;
  transition: background 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}


.command-section {
  padding: 11px;
  background: rgba(40, 40, 50, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.command-section input {
  width: 100%;
  padding: 10px 0px;
  background: rgba(20, 20, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #eee;
  font-size: clamp(14px, 2vw, 16px);
  transition: all 0.2s ease;
}

.command-section input:focus {
  outline: none;
  border-color: rgba(100, 180, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(100, 180, 255, 0.2);
}

/* Анимации */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  animation: fadeIn 1.5s ease-out;
}

/* Адаптация */
@media (max-width: 768px) {
  body {
    padding: 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  }
  
  .container {
    padding: 16px;
    border-radius: 12px;
  }
  
  .top-section {
    gap: 12px;
  }
  
  .buttons-row {
    flex-direction: column;
  }
  
  .log-content-wrapper {
    height: 45vh;
    min-height: 250px;
  }
}

@media (max-width: 480px) {
  .container {
    gap: 12px;
    padding: 12px;
  }
  
  h1 {
    font-size: 1.5rem;
    margin-bottom: 16px;
  }
  
  .info-block, .control-buttons {
    min-width: 100%;
  }
  
  #log-box {
    padding: 10px;
    font-size: 13px;
  }
}

/* ── Панель игроков ─────────────────────────────── */
.players-panel {
  width: 100%;
  background: rgba(30, 30, 40, 0.7);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.panel-header {
  color: #a0e0ff;
  margin: 0 0 12px 0;
  font-size: clamp(14px, 2vw, 16px);
  font-weight: 500;
}

#player-count {
  color: #e0e0e0;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.player-list::-webkit-scrollbar {
  width: 6px;
}
.player-list::-webkit-scrollbar-track {
  background: rgba(30, 30, 40, 0.5);
  border-radius: 3px;
}
.player-list::-webkit-scrollbar-thumb {
  background: rgba(80, 80, 100, 0.7);
  border-radius: 3px;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(40, 40, 50, 0.7);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.player-item:hover {
  background: rgba(50, 50, 60, 0.8);
}

.player-name {
  color: #e0e0e0;
  font-size: 14px;
}

.player-actions {
  display: flex;
  gap: 6px;
}

.player-action-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.kick-btn {
  background: rgba(200, 150, 30, 0.8);
  color: white;
}
.kick-btn:hover {
  background: rgba(230, 180, 50, 0.9);
}

.ban-btn {
  background: rgba(180, 40, 40, 0.8);
  color: white;
}
.ban-btn:hover {
  background: rgba(210, 60, 60, 0.9);
}

.no-players {
  color: #888;
  font-style: italic;
  padding: 8px;
  text-align: center;
}