@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0f121a;
  --bg-gradient: linear-gradient(135deg, #0f121a 0%, #1e1b4b 100%);
  --card: rgba(30, 33, 40, 0.7);
  --card-hover: rgba(45, 50, 60, 0.9);
  --accent: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #3b82f6);
  --text: #ffffff;
  --muted: #9ca3af;
  --border: rgba(255,255,255,0.1);
  --win: #10b981;
  --lose: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text); display: flex; height: 100vh; overflow: hidden;
}

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
.delay-1 { animation-delay: 0.05s; } .delay-2 { animation-delay: 0.1s; } .delay-3 { animation-delay: 0.15s; }

#splash-screen { position: fixed; top:0; left:0; right:0; bottom:0; background: var(--bg-gradient); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; transition: opacity 0.5s; }
.splash-logo { width: 100px; height: 100px; object-fit: contain; margin-bottom: 20px; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
.splash-text { font-size: 20px; font-weight: 800; letter-spacing: 2px; color: #fff; }

.sidebar { width: 240px; background: rgba(17, 20, 28, 0.95); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 12px; transition: transform 0.3s ease; z-index: 100; backdrop-filter: blur(10px); }
.logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; padding: 0 12px 24px 12px; letter-spacing: 1px; }
.logo img { width: 30px; height: 30px; object-fit: contain; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 4px; transition: all 0.2s; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-item.active { color: #fff; background: var(--accent-gradient); box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3); }
.nav-item svg { width: 20px; height: 20px; fill: currentColor; }

.main { flex: 1; overflow-y: auto; padding: 20px; position: relative; }
.top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.menu-btn { display: none; background: transparent; border: none; color: var(--text); cursor: pointer; padding: 8px; }
.menu-btn svg { width: 24px; height: 24px; fill: currentColor; }
h1 { font-size: 24px; margin-bottom: 20px; font-weight: 800; letter-spacing: -0.5px; }

/* Карточки рейтинга */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; display: flex; align-items: center; cursor: pointer; transition: transform 0.2s, background 0.2s, box-shadow 0.2s; backdrop-filter: blur(10px); }
.card:hover { background: var(--card-hover); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.card-num { font-size: 18px; font-weight: 700; color: var(--muted); width: 30px; text-align: center; }
.avatar { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-gradient); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: #fff; margin-right: 14px; flex-shrink: 0; object-fit: cover; }
.info { flex: 1; }
.name { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.team-tag { font-size: 10px; background: rgba(255,255,255,0.1); padding: 2px 6px; border-radius: 4px; color: var(--muted); }
.sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.points { font-size: 12px; color: #fff; background: rgba(139, 92, 246, 0.2); border: 1px solid rgba(139, 92, 246, 0.4); padding: 6px 12px; border-radius: 20px; font-weight: 700; }

/* Кнопки */
.btn { background: var(--accent-gradient); color: #fff; border: none; padding: 12px 20px; border-radius: 12px; font-weight: 700; cursor: pointer; font-size: 14px; transition: opacity 0.2s, transform 0.1s; width: 100%; text-align: center; display: block; margin-top: 10px; font-family: 'Manrope', sans-serif; box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3); }
.btn:hover { opacity: 0.9; } .btn:active { transform: scale(0.98); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn-red { background: var(--lose); box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3); }
.btn-green { background: var(--win); box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3); }
.back-btn { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 8px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; backdrop-filter: blur(10px); }

/* Формы */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.form-control { width: 100%; background: rgba(0,0,0,0.2); border: 1px solid var(--border); color: var(--text); padding: 14px; border-radius: 10px; font-size: 14px; outline: none; font-family: 'Manrope', sans-serif; transition: border 0.2s; }
.form-control:focus { border-color: var(--accent); }
.search-input { width: 100%; background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 12px 16px; border-radius: 12px; font-size: 14px; outline: none; margin-bottom: 20px; }

/* Строки состава */
.player-row-admin { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; background: rgba(0,0,0,0.2); padding: 10px; border-radius: 10px; border: 1px solid var(--border); }
.player-row-admin .num { font-weight: 700; color: var(--muted); width: 20px; text-align: center; margin-top: 12px; }

/* Загрузка файла */
.file-upload-wrapper { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.2); border: 1px dashed var(--border); padding: 10px; border-radius: 10px; cursor: pointer; }
.file-upload-wrapper input[type="file"] { display: none; }
.file-upload-label { font-size: 14px; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.file-upload-preview { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: none; }

/* Матчи и Таблицы */
.match-card-img { background: var(--card); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 16px; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s; backdrop-filter: blur(10px); }
.match-map-bg { height: 120px; background-size: cover; background-position: center; position: relative; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.match-map-bg::before { content: ''; position: absolute; top:0; left:0; right:0; bottom:0; background: linear-gradient(to right, rgba(15,18,26,0.9) 0%, rgba(15,18,26,0.3) 50%, rgba(15,18,26,0.9) 100%); z-index: 0; }
.match-map-content { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; width: 100%; }
.match-team-name { font-size: 16px; font-weight: 800; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.match-score-big { font-size: 24px; font-weight: 800; font-family: monospace; background: rgba(0,0,0,0.6); padding: 4px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); }

.table-wrapper { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); backdrop-filter: blur(10px); }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.2); }
th:nth-child(n+2) { text-align: center; }
td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); }
td:nth-child(n+2) { text-align: center; }
.player-cell { display: flex; align-items: center; gap: 10px; }
.player-avatar { width: 32px; height: 32px; border-radius: 50%; background: #333; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; object-fit: cover; }
.role-badge { font-size: 10px; background: rgba(255,255,255,0.1); padding: 2px 6px; border-radius: 4px; color: var(--muted); margin-left: 6px; font-weight: 600; }

.team-header { background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%); border-radius: 20px; padding: 24px; margin-bottom: 20px; border: 1px solid var(--border); display: flex; align-items: center; gap: 20px; }
.team-big-logo { width: 64px; height: 64px; border-radius: 16px; background: #333; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; object-fit: cover; }
.team-title-info h2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.team-stats-row { display: flex; gap: 12px; width: 100%; margin-bottom: 20px; }
.team-stat-box { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; backdrop-filter: blur(10px); }
.team-stat-box .val { font-size: 24px; font-weight: 800; }
.team-stat-box .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; font-weight: 600; }

.hidden { display: none !important; }
@media (max-width: 768px) {
  .sidebar { position: absolute; height: 100%; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: block; }
  .overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 90; display: none; }
  .overlay.open { display: block; }
  .team-header { flex-direction: column; text-align: center; }
  .team-stats-row { flex-direction: column; }
  .player-row-admin { flex-direction: column; }
  .player-row-admin .num { margin-top: 0; text-align: left; }
}

/* --- ИСПРАВЛЕНИЕ САЙДБАРА (на всю высоту) --- */
.sidebar {
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  width: 220px;
  background: rgba(17, 20, 28, 0.95);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 10px;
  z-index: 100;
  backdrop-filter: blur(10px);
}

/* Логотип */
.sidebar .logo {
  padding: 0 12px 30px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Кнопки */
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.2s;
}

.sidebar .nav-item.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* Контент сдвигаем вправо */
.main {
  margin-left: 220px !important;
  padding: 20px !important;
  min-height: 100vh;
}
