/* === СБРОС СТИЛЕЙ === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =============================================== */
/* ОБЩИЕ СТИЛИ САЙТА                              */
/* =============================================== */

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  background-color: #000000;
  color: #ffffff;
  font-family: Arial, sans-serif;
}

h1 {
  font-family: Impact, sans-serif;
  font-size: 18pt;
  font-weight: bold;
  color: #3d85c6;
  text-align: center;
  padding-top: 40px;
}

.meta {
  font-family: 'Roboto', sans-serif;
  font-size: 10pt;
  color: #b7b7b7;
  text-align: left;
  margin-bottom: 20px;
}

hr {
  border: none;
  border-top: 1px solid #444;
  margin: 30px 0;
}

.joke, .subheading {
  font-family: Impact, sans-serif;
  font-size: 16pt;
  color: #3d85c6;
  text-align: center;
  margin: 20px 0;
}

.content {
  font-family: Arial, sans-serif;
  font-size: 12pt;
  color: #ffffff;
  line-height: 1.6;
  margin: 0;
}

.content img {
  display: block;
  margin: 20px auto;
  max-width: 100%;
  height: auto;
}

a {
  color: #808080;
  font-weight: bold;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-wrapper {
    padding: 0 60px;
}

li {
  list-style-type: square;
}

.top-banner {
  width: 100%;
  overflow: hidden;
  max-height: 60vh;
}

.top-banner img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  object-position: center;
  max-height: 60vh;
}

@media (max-width: 600px) {
  .top-banner {
    max-height: 40vh;
  }
  .top-banner img {
    max-height: 40vh;
  }
}

/* =============================================== */
/* СТИЛИ ДЛЯ НОВОСТЕЙ                             */
/* =============================================== */

.header {
  text-align: center;
  color: #3d85c6;
  font-size: 34px;
  margin: 20px 0;
  font-family: Impact, sans-serif;
  text-shadow: 0 0 10px rgba(61, 133, 198, 0.3);
  opacity: 0;
  animation: fadeInDown 0.8s ease forwards;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Стили для кнопок переключения источников */
.source-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.source-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  border: 2px solid #3d85c6;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.source-btn:hover {
  background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(61, 133, 198, 0.4);
}

.source-btn.active {
  background: linear-gradient(135deg, #3d85c6, #2a5a8a);
  box-shadow: 0 4px 8px rgba(61, 133, 198, 0.5);
}

#last-posts {
  color: white;
  font-family: sans-serif;
  padding: 0 40px;
  max-width: 1200px;
  margin: 0 auto;
}

#last-posts a {
  color: white;
  font-weight: bold;
  text-decoration: none;
}

#last-posts a:hover {
  text-decoration: underline;
}

.post-date {
  font-size: 0.8em;
  color: #aaa;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
}

.forward-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 8px 16px;
  font-size: 0.9em;
  color: white;
  background: linear-gradient(135deg, #0088cc, #005580);
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 136, 204, 0.3);
}

.forward-btn:hover {
  background: linear-gradient(135deg, #0099ff, #0066aa);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 136, 204, 0.4);
}

.user-role {
  color: #777;
  font-weight: normal;
}

.post-container {
  margin-bottom: 1.5em;
  padding: 20px;
  border: 1px solid #333;
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  animation: fadeInUpNews 0.5s ease forwards;
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.post-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #3d85c6, #2a5a8a);
  border-radius: 4px 0 0 4px;
}

.post-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4);
}

@keyframes fadeInUpNews {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 10px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar-small:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(61, 133, 198, 0.6);
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  min-height: 200px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(61, 133, 198, 0.2);
  border-radius: 50%;
  border-top-color: #3d85c6;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  font-size: 18px;
  color: #888;
  text-align: center;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.error {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeInUpNews 0.5s ease forwards;
}

.m5-rsshub-m5wiki-error {
  color: #f44336;
  border-left: 4px solid #f44336;
  background-color: rgba(244, 67, 54, 0.1);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  animation: slideInRight 0.5s ease forwards;
}

/* ИЗМЕНЕНО: Цвет ошибки M5ProjectBase теперь красный, как у m5wiki */
.m5-rsshub-m5projectbase-error {
  color: #f44336;
  border-left: 4px solid #f44336;
  background-color: rgba(244, 67, 54, 0.1);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  animation: slideInRight 0.5s ease forwards;
}

.m5-github-admin-error {
  color: #ff9800;
  border-left: 4px solid #ff9800;
  background-color: rgba(255, 152, 0, 0.1);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  animation: slideInRight 0.5s ease forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.icon {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  display: inline-block;
  vertical-align: middle;
}

.icon-calendar {
  fill: #aaa;
}

.icon-telegram {
  fill: white;
  margin-right: 6px;
}

.icon-user {
  fill: #aaa;
}

.icon-loading {
  animation: spin 1s linear infinite;
  fill: #3d85c6;
}

.icon-error {
  fill: #ff5555;
}

.icon-warning {
  fill: #ff9800;
}

.author-info {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 3px solid #3d85c6;
  transition: background-color 0.3s ease;
}

.author-info:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.post-content {
  margin-top: 15px;
  line-height: 1.6;
  font-size: 15px;
}

.post-content p {
  margin: 10px 0;
}

.error-code, .warning-code {
  font-family: monospace;
  font-weight: bold;
  font-size: 0.9em;
  margin-top: 8px;
  text-align: right;
}

.error-code {
  color: #ff5555;
}

.warning-code {
  color: #ff9800;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .header {
    font-size: 28px;
  }
  
  #last-posts {
    padding: 0 20px;
  }
  
  .post-container {
    padding: 15px;
  }
  
  .forward-btn {
    padding: 6px 12px;
    font-size: 0.8em;
  }
  
  .avatar-small {
    width: 28px;
    height: 28px;
    margin-right: 8px;
  }
  
  .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
  }
  
  .source-buttons {
    gap: 10px;
  }
  
  .source-btn {
    padding: 8px 15px;
    font-size: 14px;
  }
}

/* =============================================== */
/* СТИЛИ ДЛЯ ПЛАНА РАЗРАБОТКИ                     */
/* =============================================== */

#columns {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#columns.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

#columns.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.month-column {
  background-color: #1e1e1e;
  border-radius: 12px;
  padding: 15px;
  width: 280px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUpPlan 0.4s ease forwards;
}

@keyframes fadeInUpPlan {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.month-header {
  font-size: 18px;
  text-align: center;
  margin-bottom: 12px;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
}

.item {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 6px;
  background-color: #2a2a2a;
  transition: background-color 0.2s;
  cursor: pointer;
  position: relative;
}

.item:hover {
  background-color: #333;
}

.item[data-status="планируется"] { 
  border-left: 5px solid #00aaff;
}

.item[data-status="в процессе"] { 
  border-left: 5px solid #ffaa00;
}

.item[data-status="готово"] { 
  border-left: 5px solid #00cc66;
}

.item[data-status="приостановлено"] { 
  border-left: 5px solid #ff3333;
}

.item .content {
  display: none;
  font-size: 14px;
  color: #bbb;
  margin-top: 10px;
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px dashed #444;
}

.item .content.visible {
  display: block;
  animation: fadeInPlan 0.3s ease;
}

@keyframes fadeInPlan {
  from { opacity: 0; }
  to { opacity: 1; }
}

.status {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

.status-icon {
  margin-right: 8px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-icon svg {
  width: 18px;
  height: 18px;
}

.item[data-status="планируется"] .status-icon svg {
  fill: #00aaff;
}

.item[data-status="в процессе"] .status-icon svg {
  fill: #ffaa00;
}

.item[data-status="готово"] .status-icon svg {
  fill: #00cc66;
}

.item[data-status="приостановлено"] .status-icon svg {
  fill: #ff3333;
}

/* Анимация для иконки "в процессе" */
.item[data-status="в процессе"] .status-icon svg {
  animation: spin 3s linear infinite;
}

/* Новый стиль для блока с назначениями */
.assign-info {
  font-size: 12px;
  color: #888;
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.assign-info a {
  color: #888;
  text-decoration: none;
  font-weight: normal;
}

.assign-info a:hover {
  text-decoration: underline;
}

#nav-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

button {
  background-color: #222;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

button:hover:not(:disabled) {
  background-color: #444;
  transform: translateY(-2px);
}

button:disabled {
  opacity: 0.4;
  cursor: default;
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Индикатор загрузки */
.loading {
  text-align: center;
  padding: 20px;
  font-style: italic;
  color: #888;
}

/* Индикатор текущего месяца */
.current-month {
  position: relative;
}

.current-month::after {
  content: "Текущий месяц";
  position: absolute;
  top: -10px;
  right: 10px;
  background-color: #015394;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
}

/* Стили для ошибок и предупреждений */
.m5-github-plan-error {
  color: #f44336;
  border-left: 4px solid #f44336;
  background-color: rgba(244, 67, 54, 0.1);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  animation: slideInRight 0.5s ease forwards;
}

/* Контейнер для ошибок с вертикальным расположением */
.errors-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .month-column {
    width: 220px;
  }
  h1 {
    font-size: 1.5em;
  }
  .header {
    font-size: 28px;
  }
}

/* =============================================== */
/* СТИЛИ ДЛЯ БОКОВОЙ ПАНЕЛИ И КНОПКИ               */
/* =============================================== */

.menu-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    padding: 0;
    cursor: pointer;
    background-color: transparent;
    border: none;
    border-radius: 5px;
}

.menu-button img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.sidebar {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    background-color: #111;
    overflow-x: hidden;
    padding-top: 60px;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-content {
    padding: 0 20px;
}

.sidebar-logo {
    display: block;
    max-width: 80%;
    height: auto;
    margin: 0 auto 20px auto;
}

.sidebar-content li {
    list-style-type: none;
    margin: 0;
}

.sidebar-content ul li a {
    display: block;
    padding: 18px 5px;
    text-decoration: none;
    color: #b7b7b7;
    font-size: 14px;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 4px;
    margin-bottom: 2px;
}

.sidebar-content ul li a:hover {
    color: #ffffff;
    background-color: #015394;
}

.sidebar .closebtn {
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 40px;
    text-decoration: none;
    color: #ffffff;
}

/* =================================================================== */
/* НОВЫЕ СТИЛИ: ДЛЯ ДЕРЕВА НАВИГАЦИИ И НОВОГО РАЗДЕЛА В БОКОВОЙ ПАНЕЛИ */
/* =================================================================== */

.sidebar-content ul ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    padding-left: 20px;
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-content .has-children.expanded > ul {
    max-height: 500px;
    transition: max-height 0.4s ease-in;
}

.sidebar-content .has-children {
    position: relative;
}

.sidebar-content .has-children > a {
    padding-right: 40px;
}

.sidebar-content .arrow {
    position: absolute;
    right: 15px;
    top: 20px;
    cursor: pointer;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #3d85c6;
    transition: transform 0.3s ease;
}

.sidebar-content .has-children.expanded > .arrow {
    transform: rotate(90deg);
}

.sidebar-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.sidebar-section h4 {
    font-family: Impact, sans-serif;
    font-size: 16pt;
    color: #3d85c6;
    margin-bottom: 15px;
}


/* =============================================== */
/* СТИЛИ ДЛЯ ФУТЕРА                               */
/* =============================================== */

.m5-footer {
  margin-top: 80px;
  background-color: #015394;
  color: white;
  font-family: Arial, sans-serif;
  animation: fadeInPage 1.2s ease-out;
}

@keyframes fadeInPage {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.gradient-top {
  height: 50px;
  background: linear-gradient(to bottom, black, #015394);
}

.m5-footer .container {
  padding: 40px;
  text-align: center;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.card {
  background-color: #003b6f;
  border-radius: 12px;
  padding: 20px;
  width: 250px;
  animation: fadeInUp 1s ease forwards;
  opacity: 0;
}

.card:nth-child(1) { animation-delay: 0.2s; }
.card:nth-child(2) { animation-delay: 0.4s; }
.card:nth-child(3) { animation-delay: 0.6s; }
.card:nth-child(4) { animation-delay: 0.8s; }

.card img {
  width: 100px;
  height: 100px;
  border-radius: 20%;
}

.card h3 {
  margin: 10px 0 5px;
}

.card p {
  font-size: 14px;
  color: #9fc5e8;
  margin-bottom: 15px;
}

.card a.button {
  display: inline-block;
  padding: 8px 16px;
  background-color: transparent;
  border: 2px solid #ffffff;
  color: #ffffff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background-color 0.3s, color 0.3s, transform 0.2s;
}

.card a.button:hover {
  background-color: #ffffff;
  color: #003b6f;
  transform: translateY(-2px);
}

.divider {
  height: 1px;
  background-color: #ffffff;
  opacity: 0.3;
  margin: 40px 0;
}

.disclaimer {
  font-size: 15px;
  color: #9fc5e8;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

.disclaimer-title {
  text-align: center;
  font-family: Impact, Charcoal, sans-serif;
  font-size: 18pt;
  color: #9fc5e8;
  margin-bottom: 10px;
}


/* ============================================================= */
/* НОВЫЙ РАЗДЕЛ: УНИКАЛЬНЫЕ СТИЛИ ТОЛЬКО ДЛЯ СТРАНИЦЫ 404      */
/* ============================================================= */

.error-404-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100vh; 
  padding: 20px;
  box-sizing: border-box;
}

.error-404-wrapper h1 {
  font-size: 120pt; 
  margin: 0;
  line-height: 1.2;
  padding: 0; 
}

.error-404-wrapper .subheading {
  font-size: 28pt;
  margin: 10px 0 40px 0;
}

.error-404-wrapper .content {
  font-size: 14pt;
  max-width: 600px;
  margin: 0 auto; 
}

.error-404-wrapper .content p {
  margin-bottom: 20px;
}

.error-404-wrapper .home-button {
  display: inline-block;
  padding: 12px 24px;
  background-color: transparent;
  border: 2px solid #ffffff;
  color: #ffffff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14pt;
  transition: background-color 0.3s, color 0.3s, transform 0.2s;
}

.error-404-wrapper .home-button:hover {
  background-color: #ffffff;
  color: #003b6f;
  transform: translateY(-2px);
  text-decoration: none; 
}

.error-404-wrapper .error-code {
  font-family: monospace;
  font-weight: bold;
  font-size: 13px;
  color: #b7b7b7;
  margin-top: 30px;
  text-align: center;
}

/* =============================================== */
/* СТИЛИ ДЛЯ ВИДЖЕТА КОНКУРСА "НОВОГОДНЯЯ ФЕРМА" */
/* =============================================== */

.contest-leaderboard-widget {
  width: 100%;
  max-width: 800px; /* Чуть шире для 3D эффекта */
  margin: 40px auto;
  background: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: visible; /* Меняем на visible, чтобы 3D элементы выходили за пределы */
}

.contest-widget-header {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 20px;
}

.contest-widget-header h1 {
  font-family: Impact, sans-serif;
  font-size: 2.8rem;
  margin: 0;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(61, 133, 198, 0.7);
  padding-top: 0;
}

.contest-widget-subtitle {
  font-size: 1rem;
  color: #b7b7b7;
  margin: 5px 0 0 0;
}

.contest-chart-container {
  padding: 10px 0;
}

.contest-bar {
  margin-bottom: 35px; /* Увеличиваем отступ для 3D */
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUpContest 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fadeInUpContest {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.contest-bar-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1.1rem;
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.contest-bar-name {
  font-weight: 800;
  letter-spacing: 0.5px;
}

.contest-bar-score {
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
}

.contest-bar-track {
  width: 100%;
  height: 35px; /* Делаем столбики еще толще */
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  position: relative;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.7);
}

.contest-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 8px;
  transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  /* --- ВОЛШЕБСТВО 3D --- */
  box-shadow: -8px 8px 0 #0a0a14; /* Тень создает боковую грань */
}

/* --- ВОЛШЕБСТВО 3D: ВЕРХНЯЯ ГРАНЬ --- */
.contest-bar-fill::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  width: 100%;
  height: 35px;
  border-radius: 8px 8px 0 0;
  background: inherit; /* Наследует градиент от родителя */
  filter: brightness(1.2); /* Делаем верхнюю грань светлее */
  transform: skewY(-5deg); /* Наклон для изометрии */
  transform-origin: bottom left;
}

/* Градиенты и свечение для топ-3 и остальных */
.contest-bar:nth-child(1) .contest-bar-fill {
  background: linear-gradient(90deg, #FFD700, #FFA500);
  box-shadow: -8px 8px 0 #cc8800, 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4);
  animation: pulse-gold 2s infinite;
}
.contest-bar:nth-child(2) .contest-bar-fill {
  background: linear-gradient(90deg, #C0C0C0, #808080);
  box-shadow: -8px 8px 0 #606060, 0 0 25px rgba(192, 192, 192, 0.7);
}
.contest-bar:nth-child(3) .contest-bar-fill {
  background: linear-gradient(90deg, #CD7F32, #8B4513);
  box-shadow: -8px 8px 0 #6b3410, 0 0 25px rgba(205, 127, 50, 0.7);
}
.contest-bar:nth-child(n+4) .contest-bar-fill {
  background: linear-gradient(90deg, #4a90e2, #0a4d8f);
  box-shadow: -8px 8px 0 #063060;
}

/* Анимация пульсации для первого места */
@keyframes pulse-gold {
  0%, 100% { box-shadow: -8px 8px 0 #cc8800, 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: -8px 8px 0 #cc8800, 0 0 40px rgba(255, 215, 0, 1), 0 0 80px rgba(255, 215, 0, 0.6); }
}


.contest-loading {
  text-align: center;
  font-size: 1.2rem;
  padding: 40px;
  color: #aaa;
}
