/* Мотивационная программа — Территория первых (без новогодней тематики) */
:root {
  --t2-pink: #FF0080;
  --t2-purple: #764ba2;
  --t2-blue: #4A90E2;
  --gold: #FFD700;
  --orange: #FF6B35;
  --gradient-hero: linear-gradient(135deg, #FF0080 0%, #764ba2 50%, #4A90E2 100%);
  --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.2);
  --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  color: #fff;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* ===== АНИМИРОВАННЫЙ ФОН С ЧАСТИЦАМИ ===== */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: floatParticle 15s infinite ease-in-out;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.particle:nth-child(1) {
  left: 10%;
  animation-delay: 0s;
  animation-duration: 12s;
}

.particle:nth-child(2) {
  left: 20%;
  animation-delay: 2s;
  animation-duration: 18s;
}

.particle:nth-child(3) {
  left: 30%;
  animation-delay: 4s;
  animation-duration: 15s;
}

.particle:nth-child(4) {
  left: 40%;
  animation-delay: 1s;
  animation-duration: 20s;
}

.particle:nth-child(5) {
  left: 50%;
  animation-delay: 3s;
  animation-duration: 14s;
}

.particle:nth-child(6) {
  left: 60%;
  animation-delay: 5s;
  animation-duration: 16s;
}

.particle:nth-child(7) {
  left: 70%;
  animation-delay: 2.5s;
  animation-duration: 19s;
}

.particle:nth-child(8) {
  left: 80%;
  animation-delay: 4.5s;
  animation-duration: 13s;
}

.particle:nth-child(9) {
  left: 90%;
  animation-delay: 1.5s;
  animation-duration: 17s;
}

.particle:nth-child(10) {
  left: 15%;
  animation-delay: 6s;
  animation-duration: 21s;
}

@keyframes floatParticle {
  0% {
    transform: translateY(100vh) translateX(0) scale(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: translateY(90vh) translateX(10px) scale(1);
  }

  90% {
    opacity: 1;
    transform: translateY(10vh) translateX(-10px) scale(1);
  }

  100% {
    transform: translateY(-10vh) translateX(0) scale(0);
    opacity: 0;
  }
}

.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  background-size: 200% 200%;
  animation: gradientShift 10s ease infinite;
  padding: 2rem;
  overflow: hidden;
  z-index: 2;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 0, 128, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(74, 144, 226, 0.3) 0%, transparent 50%);
  animation: pulseGlow 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.hero-content {
  max-width: 1200px;
  text-align: center;
  position: relative;
  z-index: 10;
}

.update-timer {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: 50px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

#timer-value {
  color: var(--gold);
  font-size: 1.2em;
}

.hero-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #fff, var(--gold), #fff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine 3s linear infinite, titleGlow 2s ease-in-out infinite alternate;
  margin-top: 40vh;
  margin-bottom: 1.5rem;
  position: relative;
  filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

@keyframes titleGlow {
  from {
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
  }

  to {
    filter: drop-shadow(0 0 50px rgba(255, 215, 0, 0.8));
  }
}

.hero-subtitle {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  margin-bottom: 3rem;
  color: #fff;
  font-weight: 600;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.hero-cta {
  margin: 3rem 0;
}

.cta-primary {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  background: linear-gradient(90deg, var(--orange), var(--t2-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.cta-secondary {
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 900;
  background: linear-gradient(90deg, var(--t2-pink), var(--t2-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-prizes {
  margin: 3rem 0;
}

.prizes-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.95);
}

.prizes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.prize-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 2.5rem 2rem;
  transition: all 0.4s ease;
}

.prize-card.gold {
  border-color: var(--gold);
}

.prize-card.silver {
  border-color: #C0C0C0;
}

.prize-card.bronze {
  border-color: #CD7F32;
}

.prize-medal {
  font-size: 4rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.prize-medal span {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: white;
  color: #333;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.prize-amount {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
  margin: 1rem 0;
}

.prize-place {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
}

.scroll-down {
  margin-top: 4rem;
}

.scroll-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.scroll-link:hover {
  transform: translateY(10px);
}

.scroll-link.cta-move {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  font-weight: 700;
}

.scroll-link.cta-move {
  position: relative;
  overflow: hidden;
}

.scroll-link.cta-move::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.scroll-link.cta-move:hover::before {
  width: 300px;
  height: 300px;
}

.scroll-link.cta-move:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: #fff;
  transform: scale(1.05);
}

.scroll-arrow {
  font-size: 2rem;
  animation: bounce 2s ease-in-out infinite;
  display: inline-block;
  transition: transform 0.3s ease;
}

.scroll-link:hover .scroll-arrow {
  transform: translateY(10px) scale(1.2);
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(15px);
  }
}

.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
  position: relative;
  z-index: 5;
}

/* Параллакс эффект для секций */
.section-title {
  animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Эффект свечения для топ-3 */
.row-top3 {
  position: relative;
}

.row-top3::after {
  content: '🏆';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  animation: trophyBounce 1s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes trophyBounce {

  0%,
  100% {
    transform: translateY(-50%) rotate(0deg);
  }

  25% {
    transform: translateY(-55%) rotate(-10deg);
  }

  75% {
    transform: translateY(-45%) rotate(10deg);
  }
}

/* Параллакс эффект для секций */
.section-title {
  animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Эффект свечения для топ-3 */
.row-top3 {
  position: relative;
}

.row-top3::after {
  content: '🏆';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  animation: trophyBounce 1s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes trophyBounce {

  0%,
  100% {
    transform: translateY(-50%) rotate(0deg);
  }

  25% {
    transform: translateY(-55%) rotate(-10deg);
  }

  75% {
    transform: translateY(-45%) rotate(10deg);
  }
}

/* диагностика файла */
.diag-block {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  color: #333;
  display: none;
}

.diag-heading {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.diag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.diag-label {
  font-weight: 600;
}

.diag-label-time {
  margin-left: 1rem;
}

.diag-status {
  font-weight: 700;
}

.diag-status.diag-ok {
  color: #2d6b3a;
}

.diag-status.diag-warn {
  color: #b8860b;
}

.diag-status.diag-error {
  color: #c44;
}

.diag-time {
  color: #555;
}

.diag-path-hint {
  font-family: monospace;
  font-weight: 600;
  color: #0a7;
  margin-right: 0.5rem;
}
.diag-path-warn {
  font-size: 0.85rem;
  color: #c60;
  font-style: italic;
}
.diag-row-path {
  gap: 0.35rem;
}
.diag-url,
.diag-http,
.diag-format,
.diag-xlsx,
.diag-assets,
.diag-build,
.diag-resources {
  word-break: break-all;
  font-size: 0.9rem;
  color: #555;
}

.diag-errors,
.diag-warnings {
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
  color: #555;
}

.diag-errors {
  color: #c44;
}

.diag-warnings {
  color: #8a6d00;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--t2-pink), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInScale 0.8s ease-out;
  position: relative;
  filter: drop-shadow(0 2px 10px rgba(255, 0, 128, 0.3));
}

.section-subtitle {
  text-align: center;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 3rem;
}

.how-it-works-section {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  padding: 4rem 2rem;
  margin-bottom: 4rem;
}

.how-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

.how-card {
  background: rgba(10, 10, 30, 0.6);
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  padding: 2.5rem;
  transition: all 0.4s ease;
}

.how-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-strong);
}

.pink-card {
  border-color: var(--t2-pink);
}

.blue-card {
  border-color: var(--t2-blue);
}

.garland-card {
  border-color: var(--gold);
}

.card-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.card-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
}

.card-highlight {
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  margin: 1.5rem 0;
}

.card-highlight-small {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 1rem;
}

.card-description {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
}

.card-note {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  margin-top: 1rem;
}

.card-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.card-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: rgba(255, 255, 255, 0.9);
}

.card-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: bold;
}

.additional-rules-section {
  padding: 80px 20px;
  background: transparent;
}

.rules-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

.rule-info-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  padding: 40px 30px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s ease;
}

.rule-info-card:hover {
  transform: translateY(-10px);
}

.purple-card {
  border-color: rgba(138, 43, 226, 0.3);
}

.pink-gradient-card {
  border-color: rgba(255, 0, 128, 0.3);
}

.warning-card {
  border: 3px solid rgba(255, 140, 0, 0.5);
}

.card-emoji {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 20px;
}

.rule-info-card h3 {
  font-size: 28px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 20px;
  color: #FFD700;
  text-transform: uppercase;
}

.card-text {
  font-size: 18px;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.9);
}

.card-text-bold {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 15px;
  color: #fff;
}

.card-percent {
  font-size: 48px;
  font-weight: 900;
  text-align: center;
  color: #FF1493;
  margin: 20px 0;
}

.card-note-small {
  font-size: 15px;
  text-align: center;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

.prizes-heading {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin: 25px 0 15px;
  color: #FFD700;
}

.prizes-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.prizes-list li {
  font-size: 18px;
  line-height: 2;
  text-align: center;
  color: #fff;
}

.rating-section {
  margin-bottom: 4rem;
}

.top-managers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.manager-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
}

.manager-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.manager-card:hover {
  transform: translateY(-15px) rotateY(5deg) scale(1.05);
  box-shadow: 0 30px 60px rgba(255, 215, 0, 0.4), 0 0 0 3px rgba(255, 215, 0, 0.3);
  border-color: var(--gold);
}

.manager-card:hover::before {
  opacity: 1;
  animation: rotateGlow 3s linear infinite;
}

@keyframes rotateGlow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.manager-rank {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 2.5rem;
}

.manager-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  border: 4px solid var(--gold);
  box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
  background: linear-gradient(135deg, var(--t2-pink), var(--t2-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
  position: relative;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.manager-avatar::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(45deg, var(--t2-pink), var(--t2-purple), var(--t2-blue), var(--gold));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotateBorder 3s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.manager-card:hover .manager-avatar::before {
  opacity: 1;
}

.manager-card:hover .manager-avatar {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 10px 40px rgba(255, 215, 0, 0.6);
}

@keyframes rotateBorder {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.manager-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  transition: transform 0.5s ease;
}

.manager-card:hover .manager-photo {
  transform: scale(1.1);
}

.manager-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
}

.manager-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.stat-badge {
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  font-size: 0.95rem;
}

.dop-kpi-section {
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  margin: 2rem 0;
}

.dop-kpi-section .section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

.dop-kpi-section .section-subtitle {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.8);
}

.update-info {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  margin-bottom: 2rem;
  color: #333;
}

.update-label {
  font-weight: 600;
  color: #555;
  margin-right: 0.5rem;
}

.update-time {
  color: #2d9668;
  font-weight: 700;
  font-size: 1.1rem;
}

.ranking-logic-info {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  margin-bottom: 2rem;
  border: 2px solid rgba(255, 0, 128, 0.3);
  overflow: hidden;
}

.logic-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  cursor: pointer;
  background: rgba(255, 0, 128, 0.1);
  user-select: none;
}

.logic-header:hover {
  background: rgba(255, 0, 128, 0.2);
}

.logic-icon {
  font-size: 1.5rem;
  margin-right: 0.75rem;
}

.logic-title {
  flex: 1;
  font-weight: 700;
  font-size: 1.1rem;
  color: #FF0080;
}

.logic-arrow {
  font-size: 1.2rem;
  color: #FF0080;
}

.logic-content {
  padding: 1.5rem;
  color: #333;
  background: white;
  border-top: 1px solid rgba(255, 0, 128, 0.2);
}

.logic-content p,
.logic-content ol,
.logic-content li {
  margin: 0.75rem 0;
  line-height: 1.6;
}

.logic-content ol {
  padding-left: 1.5rem;
}

.leaderboard-section {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 30px;
  padding: 3rem 2rem;
  margin-bottom: 4rem;
  box-shadow: var(--shadow-medium);
  position: relative;
  overflow: hidden;
}

.leaderboard-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 0, 128, 0.1) 0%, transparent 70%);
  animation: rotateBackground 20s linear infinite;
  pointer-events: none;
}

@keyframes rotateBackground {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.leaderboard-section .section-title {
  color: var(--t2-pink);
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 15px;
  margin-top: 2rem;
}

/* ============================================
   ТАБЛИЦЫ РЕЙТИНГА - ПОЛНАЯ ПЕРЕПИСЬ С НУЛЯ
   ============================================ */

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  table-layout: auto;
}

/* Заголовок таблицы */
.ranking-table thead {
  background: linear-gradient(90deg, var(--t2-pink), var(--t2-purple));
  color: white;
}

.ranking-table thead tr {
  display: table-row;
}

.ranking-table thead th {
  display: table-cell;
  padding: 1.2rem 1rem;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 1px;
  border: none;
  vertical-align: middle;
  box-sizing: border-box;
}

/* Тело таблицы */
.ranking-table tbody {
  display: table-row-group;
}

.ranking-table tbody tr {
  display: table-row;
  color: #333;
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.3s ease;
}

.ranking-table tbody tr:last-child {
  border-bottom: none;
}

.ranking-table tbody td {
  display: table-cell;
  padding: 1.2rem 1rem;
  text-align: center;
  border: none;
  vertical-align: middle;
  box-sizing: border-box;
}

/* Выравнивание ячеек с аватарами */
.ranking-table tbody td.name-with-avatar {
  text-align: left;
  vertical-align: middle;
  padding: 1.2rem 1rem;
}

.ranking-table tbody td.name-with-avatar .name-with-avatar {
  height: 100%;
  min-height: 56px;
}

/* Эффекты при наведении */
.ranking-table tbody tr:hover {
  background: rgba(255, 0, 128, 0.08);
}

/* Первая строка (топ-1) */
.ranking-table tbody tr:nth-child(1) {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.25), rgba(255, 215, 0, 0.1));
  font-weight: 700;
}

/* Топ-3 строки */
.ranking-table tbody tr.row-top3 {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), transparent);
}

.week-details-cell {
  vertical-align: top;
  padding: 0.75rem 0.5rem !important;
}

.week-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 100px;
}

.week-rating {
  font-size: 1.2rem;
  font-weight: 900;
  color: #2E7D32;
  text-align: center;
}

.week-rating-fail {
  font-size: 1.2rem;
  font-weight: 900;
  color: #E53935;
  text-align: center;
}

.week-formula {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: #666;
}

.formula-item {
  display: block;
  padding: 0.15rem 0.25rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
}

.week-formula-result {
  font-size: 0.7rem;
  color: #43A047;
  font-weight: 700;
  text-align: center;
  margin-top: 0.25rem;
  padding: 0.25rem;
  background: rgba(67, 160, 71, 0.1);
  border-radius: 4px;
}

.week-status-note {
  font-size: 0.7rem;
  color: #E53935;
  font-weight: 600;
  text-align: center;
  font-style: italic;
}

.calculation-cell {
  vertical-align: top;
  padding: 0.75rem 0.5rem !important;
  min-width: 150px;
}

.calculation-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calc-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #555;
}

.calc-values span {
  padding: 0.2rem 0.5rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  font-weight: 600;
}

.calc-formula {
  font-size: 1.2rem;
  color: #2E7D32;
  font-weight: 900;
  padding: 0.5rem;
  background: rgba(67, 160, 71, 0.15);
  border-radius: 6px;
  text-align: center;
}

.calc-note-fail {
  font-size: 0.75rem;
  color: #E53935;
  font-weight: 600;
  padding: 0.35rem;
  background: rgba(229, 57, 53, 0.1);
  border-radius: 6px;
  text-align: center;
  font-style: italic;
}

.calc-invalid {
  opacity: 0.6;
  text-decoration: line-through;
}

.invalid-mark {
  color: #E53935;
  font-weight: 900;
  margin-left: 0.25rem;
}

.formula-item-invalid {
  opacity: 0.6;
  text-decoration: line-through;
}

.formula-zero {
  color: #E53935;
  font-weight: 700;
}

.formula-note {
  font-size: 0.65rem;
  color: #E53935;
  font-style: italic;
  margin-left: 0.25rem;
}

.formula-note-small {
  font-size: 0.6rem;
  color: #E53935;
  font-style: italic;
  margin-left: 0.15rem;
}

.rules-section {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border-radius: 30px;
  padding: 4rem 2rem;
  margin-bottom: 4rem;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.rule-card {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: all 0.4s ease;
}

.rule-card:hover {
  transform: translateY(-10px);
  border-color: var(--gold);
  background: rgba(255, 215, 0, 0.15);
}

.rule-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.rule-card h3 {
  font-size: 1.5rem;
  color: white;
  margin-bottom: 1rem;
}

.rule-card p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
}

.footer {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: 3rem 2rem;
  text-align: center;
  border-top: 3px solid rgba(255, 0, 128, 0.3);
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.footer p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
}

.changes-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  max-width: 400px;
  color: #333;
}

.changes-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.changes-icon {
  font-size: 1.5rem;
}

.changes-text strong {
  display: block;
  margin-bottom: 0.5rem;
  color: #FF0080;
}

.changes-text ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.changes-text li {
  padding: 0.3rem 0;
  font-size: 0.9rem;
  color: #555;
}

.changes-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  padding: 0;
}

.data-update-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(45, 150, 104, 0.95);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.fade-in {
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ===== СОВРЕМЕННЫЙ ДИЗАЙН "КАК СЧИТАЕМ" В СТИЛЕ "ТЕРРИТОРИЯ ПЕРВЫХ" ===== */
.rules-modern {
  margin-bottom: 3rem;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
  background: var(--gradient-hero);
  background-size: 200% 200%;
  animation: gradientShift 10s ease infinite;
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rules-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 0, 128, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(74, 144, 226, 0.3) 0%, transparent 50%);
  animation: pulseGlow 8s ease-in-out infinite;
  pointer-events: none;
}

.rules-hero {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
  padding: 0;
  background: none;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.rules-hero-title {
  font-size: clamp(2.1rem, 5.6vw, 4.2rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #fff, var(--gold), #fff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine 3s linear infinite, titleGlow 2s ease-in-out infinite alternate;
  margin-bottom: 1.5rem;
  position: relative;
  filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
}

.rules-hero-title::before {
  display: none;
}

.rules-hero-subtitle {
  font-size: clamp(0.84rem, 1.75vw, 1.26rem);
  margin-bottom: 3rem;
  color: #fff;
  font-weight: 600;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.3);
  letter-spacing: normal;
}

.rules-showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.rule-feature {
  position: relative;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.rule-feature:nth-child(1) {
  animation-delay: 0.1s;
}

.rule-feature:nth-child(2) {
  animation-delay: 0.3s;
}

.rule-feature:nth-child(3) {
  animation-delay: 0.5s;
}

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

.rule-feature:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.feature-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 0, 128, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  filter: blur(60px);
}

.feature-glow--green {
  background: radial-gradient(circle, rgba(67, 160, 71, 0.4) 0%, transparent 70%);
}

.feature-glow--blue {
  background: radial-gradient(circle, rgba(30, 136, 229, 0.4) 0%, transparent 70%);
}

.feature-glow--gold {
  background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
}

.rule-feature:hover .feature-glow {
  opacity: 1;
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.feature-content {
  position: relative;
  z-index: 2;
}

.feature-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 0.75rem;
}

.feature-icon-wrapper {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 0, 128, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 14px;
  position: relative;
  transition: all 0.3s ease;
}

.rule-feature--week .feature-icon-wrapper {
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.15), rgba(102, 187, 106, 0.15));
}

.rule-feature--month .feature-icon-wrapper {
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.15), rgba(66, 165, 245, 0.15));
}

.rule-feature--reward .feature-icon-wrapper {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 167, 38, 0.15));
}

.rule-feature:hover .feature-icon-wrapper {
  transform: rotate(10deg) scale(1.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon {
  width: 32px;
  height: 32px;
  color: var(--t2-pink);
  transition: all 0.3s ease;
}

.rule-feature--week .feature-icon {
  color: #43A047;
}

.rule-feature--month .feature-icon {
  color: #1E88E5;
}

.rule-feature--reward .feature-icon {
  color: #FFD700;
}

.feature-title {
  font-size: clamp(0.7rem, 1.4vw, 0.91rem);
  font-weight: 900;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.2;
}

.feature-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

/* Условия */
.conditions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.condition-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.1), rgba(102, 187, 106, 0.05));
  border: 2px solid rgba(67, 160, 71, 0.3);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.condition-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(67, 160, 71, 0.2);
  border-color: #43A047;
}

.condition-check {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #43A047, #66BB6A);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(67, 160, 71, 0.3);
}

.condition-check svg {
  width: 18px;
  height: 18px;
  color: white;
}

.condition-info {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.condition-label {
  font-size: 0.595rem;
  color: #666;
  font-weight: 600;
}

.condition-value {
  font-size: 0.7rem;
  font-weight: 900;
  color: #2E7D32;
}

/* Формула */
.formula-showcase {
  text-align: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.1), rgba(66, 165, 245, 0.05));
  border-radius: 14px;
  border: 2px dashed rgba(30, 136, 229, 0.3);
}

.formula-label {
  font-size: 0.525rem;
  color: #666;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.formula-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.formula-term {
  padding: 0.5rem 1rem;
  font-size: 0.63rem;
  font-weight: 900;
  border-radius: 10px;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.formula-term:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes glowTerm {

  0%,
  100% {
    box-shadow: 0 6px 20px rgba(255, 0, 128, 0.3);
  }

  50% {
    box-shadow: 0 6px 30px rgba(255, 0, 128, 0.6);
  }
}

.formula-term--gi {
  background: linear-gradient(135deg, #FF0080, #FF6B9D);
}

.formula-term--split {
  background: linear-gradient(135deg, #764ba2, #9B7BC8);
}

.formula-term--credits {
  background: linear-gradient(135deg, #4A90E2, #6BA8E8);
}

.formula-plus {
  font-size: 0.875rem;
  font-weight: 900;
  color: var(--t2-pink);
}

.formula-note {
  font-size: 0.49rem;
  color: #666;
  font-style: italic;
  margin-top: 0.25rem;
}

/* Предупреждение */
.warning-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 193, 7, 0.1));
  border-left: 3px solid #FF9800;
  border-radius: 10px;
  color: #E65100;
  font-weight: 600;
  font-size: 0.56rem;
  line-height: 1.3;
}

.warning-banner svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #FF9800;
}

/* Недели */
.weeks-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.1), rgba(66, 165, 245, 0.05));
  border-radius: 14px;
}

.week-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: white;
  border: 2px solid var(--t2-blue);
  border-radius: 12px;
  width: 100%;
  transition: all 0.3s ease;
}

.week-item:hover {
  transform: scale(1.05);
  background: var(--t2-blue);
  color: white;
  box-shadow: 0 8px 25px rgba(30, 136, 229, 0.3);
}

.week-number {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--t2-blue);
  transition: color 0.3s ease;
}

.week-item:hover .week-number {
  color: white;
}

.week-label {
  font-size: 0.49rem;
  font-weight: 600;
  color: #666;
  transition: color 0.3s ease;
}

.week-item:hover .week-label {
  color: white;
}

.week-connector {
  width: 18px;
  height: 18px;
  color: var(--t2-pink);
}

.week-connector svg {
  width: 100%;
  height: 100%;
}

.month-result {
  margin-top: 1rem;
  text-align: center;
}

.result-equals {
  font-size: 1.225rem;
  font-weight: 900;
  color: var(--t2-pink);
  margin-bottom: 0.5rem;
}

.result-text {
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, var(--t2-pink), var(--t2-purple));
  color: white;
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.665rem;
  box-shadow: 0 4px 15px rgba(255, 0, 128, 0.3);
  display: inline-block;
}

/* Награды */
.reward-scenarios {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scenario {
  padding: 1rem;
  border-radius: 14px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.scenario--success {
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.1), rgba(102, 187, 106, 0.05));
  border-color: rgba(67, 160, 71, 0.3);
}

.scenario--fail {
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.1), rgba(239, 83, 80, 0.05));
  border-color: rgba(229, 57, 53, 0.3);
}

.scenario:hover {
  transform: translateX(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.scenario-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.scenario-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.scenario--success .scenario-icon {
  color: #43A047;
}

.scenario--fail .scenario-icon {
  color: #E53935;
}

.scenario-condition {
  font-size: 0.63rem;
  font-weight: 700;
  color: #333;
  line-height: 1.3;
}

.scenario-result {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.595rem;
  line-height: 1.3;
}

.scenario--success .scenario-result {
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.2), rgba(102, 187, 106, 0.1));
  color: #2E7D32;
}

.scenario--fail .scenario-result {
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.2), rgba(239, 83, 80, 0.1));
  color: #C62828;
}

.result-star {
  width: 20px;
  height: 20px;
  color: #FFD700;
  flex-shrink: 0;
}

.result-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.scenario--success .result-icon {
  color: #43A047;
}

.scenario--fail .result-icon {
  color: #E53935;
}

/* Адаптивность */
@media (max-width: 1200px) {
  .rules-showcase {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .rule-feature {
    max-width: 600px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .rules-modern {
    padding: 1.5rem 1rem;
  }

  .rules-showcase {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .formula-visual {
    flex-direction: column;
  }

  .formula-plus {
    transform: rotate(90deg);
  }

  .weeks-stack {
    padding: 1rem;
  }
}

.rules-compact {
  margin-bottom: 4rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.rules-compact .section-title {
  margin-bottom: 2rem;
  text-align: center;
}

.rules-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.rule-card-item {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  color: #333;
}

.rule-card-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--t2-pink), var(--t2-purple), var(--t2-blue));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.rule-card-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.rule-card-item:hover::before {
  transform: scaleX(1);
}

.rule-card-item--week::before {
  background: linear-gradient(90deg, #43A047, #66BB6A);
}

.rule-card-item--month::before {
  background: linear-gradient(90deg, #1E88E5, #42A5F5);
}

.rule-card-item--reward::before {
  background: linear-gradient(90deg, #FFD700, #FFA726);
}

.rule-card-icon {
  text-align: center;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--t2-pink);
}

.rule-card-icon svg {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
  transition: all 0.3s ease;
}

.rule-card-item:hover .rule-card-icon svg {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25));
}

.rule-card-item--week .rule-card-icon {
  color: #43A047;
}

.rule-card-item--month .rule-card-icon {
  color: #1E88E5;
}

.rule-card-item--reward .rule-card-icon {
  color: #FFD700;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

.rule-card-title {
  font-size: 1.5rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--t2-pink);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rule-card-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rule-condition {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rule-condition-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.1), rgba(102, 187, 106, 0.1));
  border: 2px solid rgba(67, 160, 71, 0.3);
  border-radius: 12px;
  font-weight: 700;
  color: #2E7D32;
  transition: all 0.3s ease;
}

.rule-condition-badge svg {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
}

.rule-condition-badge:hover {
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.2), rgba(102, 187, 106, 0.2));
  transform: scale(1.02);
}

.rule-badge-icon {
  width: 20px;
  height: 20px;
  color: #43A047;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
  stroke-width: 2.5;
}

.rule-badge-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

.rule-result {
  text-align: center;
  padding: 1rem;
  background: rgba(30, 136, 229, 0.1);
  border-radius: 12px;
  border: 2px dashed rgba(30, 136, 229, 0.3);
}

.rule-result-label {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.rule-result-formula {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 900;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

.formula-part {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--t2-pink), var(--t2-purple));
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 4px 10px rgba(255, 0, 128, 0.3);
  }

  50% {
    box-shadow: 0 4px 20px rgba(255, 0, 128, 0.6);
  }
}

.formula-operator {
  font-size: 1.5rem;
  color: var(--t2-pink);
  font-weight: 900;
}

.formula-plus-icon {
  width: 20px;
  height: 20px;
  color: var(--t2-pink);
  flex-shrink: 0;
}

.formula-plus-icon svg {
  width: 100%;
  height: 100%;
}

.rule-result-note {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
  margin-top: 0.5rem;
}

.rule-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 152, 0, 0.1);
  border-left: 4px solid #FF9800;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #E65100;
  font-weight: 600;
}

.rule-warning svg {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
}

.warning-icon {
  width: 20px;
  height: 20px;
  color: #FF9800;
  flex-shrink: 0;
}

.warning-icon svg {
  width: 100%;
  height: 100%;
}

.rule-formula-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.1), rgba(66, 165, 245, 0.1));
  border-radius: 16px;
  border: 2px solid rgba(30, 136, 229, 0.2);
}

.formula-week {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
}

.formula-week svg {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
}

.formula-week-label {
  padding: 0.5rem 1rem;
  background: white;
  border: 2px solid var(--t2-blue);
  border-radius: 8px;
  font-weight: 700;
  color: var(--t2-blue);
  min-width: 100px;
  text-align: center;
  transition: all 0.3s ease;
}

.formula-week-label:hover {
  background: var(--t2-blue);
  color: white;
  transform: scale(1.05);
}

.formula-equals {
  font-size: 2rem;
  font-weight: 900;
  color: var(--t2-pink);
  margin: 0.5rem 0;
}

.formula-result {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--t2-pink), var(--t2-purple));
  color: white;
  border-radius: 12px;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(255, 0, 128, 0.3);
}

.reward-condition {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.reward-condition:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(5px);
}

.reward-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.reward-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reward-icon svg {
  width: 100%;
  height: 100%;
}

.reward-icon--success {
  color: #43A047;
  filter: drop-shadow(0 4px 10px rgba(67, 160, 71, 0.4));
}

.reward-icon--fail {
  color: #E53935;
  filter: drop-shadow(0 4px 10px rgba(229, 57, 53, 0.4));
}

.reward-text {
  color: #333;
}

.reward-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
}

.reward-result--success {
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.2), rgba(102, 187, 106, 0.2));
  color: #2E7D32;
  border: 2px solid rgba(67, 160, 71, 0.3);
}

.reward-result--fail {
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.2), rgba(239, 83, 80, 0.2));
  color: #C62828;
  border: 2px solid rgba(229, 57, 53, 0.3);
}

.reward-emoji {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  animation: bounce 1s ease-in-out infinite;
}

.reward-emoji svg {
  width: 100%;
  height: 100%;
}

.reward-result--success .reward-emoji {
  color: #FFD700;
}

.reward-result--fail .reward-emoji {
  color: #E53935;
}

.rules-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.week-section {
  margin-top: 2rem;
}

/* Скрываем колонки "WeekRating" и "Статус" в таблице "Рейтинг по неделе" */
.week-section .ranking-table thead tr th:nth-child(4),
.week-section .ranking-table tbody tr td:nth-child(4),
.week-section .ranking-table thead tr th:nth-child(6),
.week-section .ranking-table tbody tr td:nth-child(6) {
  display: none;
}

.week-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.week-btn {
  padding: 0.5rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.week-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.week-btn.active {
  background: var(--t2-pink);
  border-color: #fff;
  box-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
  animation: activePulse 2s ease-in-out infinite;
}

@keyframes activePulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
  }

  50% {
    box-shadow: 0 0 30px rgba(255, 0, 128, 0.8);
  }
}

/* Подсказка «Данные не обновлены» для недель без данных */
.week-no-data-hint {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.5);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #333;
}
.week-no-data-hint code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Вкладки недель без данных — приглушённые */
.week-btn.week-no-data {
  opacity: 0.7;
  border-style: dashed;
}
.week-btn.week-no-data:hover {
  opacity: 1;
}
.map-week-btn.week-no-data {
  opacity: 0.7;
  border-style: dashed;
}
.map-week-btn.week-no-data:hover {
  opacity: 1;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.status-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.status-badge:hover::before {
  left: 100%;
}

.status-fail {
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.9), rgba(239, 83, 80, 0.9));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);
  border: 1px solid rgba(229, 57, 53, 0.5);
}

.status-ok {
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.9), rgba(102, 187, 106, 0.9));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(67, 160, 71, 0.4);
  border: 1px solid rgba(67, 160, 71, 0.5);
}

.status-closed {
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.9), rgba(102, 187, 106, 0.9));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(67, 160, 71, 0.4);
  animation: statusGlow 2s ease-in-out infinite;
  border: 1px solid rgba(67, 160, 71, 0.5);
}

@keyframes statusGlow {

  0%,
  100% {
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
  }

  50% {
    box-shadow: 0 2px 15px rgba(255, 215, 0, 0.7);
  }
}

.status-no-reward {
  background: rgba(180, 100, 50, 0.4);
  color: #ffddb3;
  box-shadow: 0 2px 8px rgba(180, 100, 50, 0.3);
}

.status-nodata {
  background: linear-gradient(135deg, rgba(120, 120, 120, 0.8), rgba(140, 140, 140, 0.8));
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(120, 120, 120, 0.5);
}

.hist-fail {
  color: #f88;
  font-weight: 700;
  animation: shake 0.5s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.hist-ok {
  color: #8f8;
  font-weight: 700;
  animation: numberPop 0.4s ease;
}

@keyframes numberPop {
  0% {
    transform: scale(0.8);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

.hist-na {
  color: rgba(255, 255, 255, 0.4);
}

/* Стиль для топ-3 уже определен выше в основных стилях таблицы */

/* ——— Лица района ——— */
.faces-section {
  margin-bottom: 4rem;
}

.faces-section .section-title {
  margin-bottom: 1.5rem;
}

.faces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.face-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  color: #333;
  position: relative;
  transform-style: preserve-3d;
}

.face-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 0, 128, 0.1), rgba(118, 75, 162, 0.1));
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: 16px;
}

.face-card:hover {
  transform: translateY(-8px) rotateX(5deg) scale(1.03);
  box-shadow: 0 20px 40px rgba(255, 0, 128, 0.3), 0 0 0 3px rgba(255, 0, 128, 0.2);
  border-color: var(--t2-pink);
}

.face-card:hover::after {
  opacity: 1;
}

.face-card-photo-wrap {
  aspect-ratio: 1;
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.face-card-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.face-card:hover .face-card-photo-wrap img {
  transform: scale(1.1) rotate(2deg);
}

.face-card-initials {
  font-size: 1.75rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ——— Аватары участников ——— */
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  background: #eee;
}

.avatar--sm {
  width: 40px;
  height: 40px;
}

.map-legend-item .avatar {
  flex-shrink: 0;
}

.name-with-avatar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  line-height: 1;
}

.name-with-avatar .avatar {
  flex-shrink: 0;
  display: block;
  margin: 0;
  vertical-align: middle;
}

.name-with-avatar img.avatar {
  display: block;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  line-height: 1;
}

.name-with-avatar .avatar {
  flex-shrink: 0;
  display: block;
  vertical-align: middle;
}

.name-with-avatar img.avatar {
  vertical-align: middle;
  margin: 0;
}

/* ——— Hero background (автоподхват images/hero/hero.jpg) ——— */
.hero-bg-ready {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero-bg-ready.hero-bg--ready {
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%), var(--hero-bg-url);
  background-size: cover;
  background-position: center;
}

/* ——— Мем недели (автоподхват images/memes/meme_w1..4.jpg) ——— */
.week-meme-block {
  display: none !important;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.week-meme-head {
  margin-bottom: 0.75rem;
}

.week-meme-head h3 {
  font-size: 1.1rem;
  color: var(--t2-pink);
  margin: 0 0 0.25rem;
}

.week-meme-sub {
  font-size: 0.9rem;
  color: #666;
}

.week-meme-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.week-meme-img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.week-meme-caption {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.5rem;
}

.week-meme--placeholder .week-meme-caption {
  opacity: 0.7;
}

@media (min-width: 640px) {
  .week-meme-body {
    grid-template-columns: 1fr 1fr;
  }
}

/* ——— Фото Перми (автоподхват images/perm/perm_01..08.jpg) ——— */
.perm-photos-slot {
  display: none !important;
  margin-bottom: 1.5rem;
}

.perm-photos-head {
  margin-bottom: 0.75rem;
}

.perm-photos-head h3 {
  font-size: 1.1rem;
  color: #333;
  margin: 0 0 0.25rem;
}

.perm-photos-sub {
  font-size: 0.9rem;
  color: #666;
}

.perm-photos-strip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
}

.perm-photo-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
  transition: transform 0.25s ease;
}

.perm-photo-card:hover {
  transform: translateY(-2px);
}

.perm-photo-card img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  display: block;
}

.perm-photo-card figcaption {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: #555;
}

@media (min-width: 640px) {
  .perm-photo-card img {
    width: 260px;
    height: 260px;
  }
}

.face-card-body {
  padding: 0.75rem 1rem;
}

.face-card-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.face-card-dealer {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.35rem;
}

.face-card-place {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--t2-pink);
}

/* ——— Карта территорий ——— */
.map-section {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 30px;
  padding: 3rem 2rem;
  margin-bottom: 4rem;
  box-shadow: var(--shadow-medium);
  position: relative;
  overflow: hidden;
}

.map-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--t2-pink) 0%, #ff6b9d 50%, var(--t2-pink) 100%);
  z-index: 1;
}

.map-section .section-title {
  color: var(--t2-pink);
}

/* ===== ИНСТРУКЦИЯ ПО ЗАХВАТУ РАЙОНОВ (раскрывающийся блок под картой) ===== */
.territory-instruction {
  background: linear-gradient(135deg, rgba(255, 0, 128, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border: 1px solid rgba(255, 0, 128, 0.25);
  border-radius: 16px;
  margin-top: 2rem;
  box-shadow: var(--shadow-soft);
}

.territory-instruction--collapsible {
  padding: 0;
}
.territory-instruction--collapsible[open] {
  padding: 0 1.5rem 1.5rem;
}
.territory-instruction-summary-trigger {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--t2-pink);
  padding: 1rem 1.5rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  user-select: none;
  border-radius: 16px;
  transition: background 0.2s;
}
.territory-instruction-summary-trigger::-webkit-details-marker,
.territory-instruction-summary-trigger::marker {
  display: none;
}
.territory-instruction-summary-trigger::after {
  content: '';
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid var(--t2-pink);
  border-bottom: 2px solid var(--t2-pink);
  transform: rotate(45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.territory-instruction--collapsible[open] .territory-instruction-summary-trigger::after {
  transform: rotate(-135deg);
}
.territory-instruction-summary-trigger:hover {
  background: rgba(255, 0, 128, 0.06);
}
.territory-instruction--collapsible .territory-instruction-content {
  padding-top: 0.5rem;
}

.territory-instruction-content {
  color: #333;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.territory-instruction-intro {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 500;
  color: #444;
}

.territory-instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.territory-step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: white;
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.territory-step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--t2-pink), var(--t2-purple));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(255, 0, 128, 0.3);
}

.territory-step-content {
  flex: 1;
  color: #333;
}

.territory-step-content strong {
  display: block;
  font-size: 1.2rem;
  color: var(--t2-pink);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.territory-step-content p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.territory-step-content ul {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

.territory-step-content li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.6;
}

.territory-step-content li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--t2-pink);
  font-weight: bold;
}

.territory-instruction-summary {
  background: rgba(255, 0, 128, 0.1);
  border-left: 4px solid var(--t2-pink);
  padding: 1rem 1.5rem;
  border-radius: 10px;
  font-size: 1.1rem;
  color: #333;
  text-align: center;
  margin-top: 1rem;
}

.territory-instruction-summary strong {
  color: var(--t2-pink);
}

/* Адаптивность инструкции и секции карты */
@media (max-width: 768px) {
  .map-section {
    padding: 2rem 1rem;
    border-radius: 20px;
    margin-bottom: 2rem;
  }

  .territory-instruction {
    padding: 1.5rem 1rem;
    margin: 1.5rem 0;
    border-radius: 16px;
  }

  .territory-instruction-title {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    margin-bottom: 0.75rem;
  }

  .territory-instruction-intro {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    padding: 0 0.25rem;
  }

  .territory-step {
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
  }

  .territory-step-number {
    align-self: flex-start;
  }

  .territory-step-content strong {
    font-size: 1.1rem;
  }

  .territory-step-content li {
    padding: 0.4rem 0;
    padding-left: 1.25rem;
    font-size: 0.95rem;
  }

  .territory-instruction-summary {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    margin-top: 0.75rem;
  }
}

@media (max-width: 480px) {
  .map-section {
    padding: 1.5rem 0.75rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
  }

  .territory-instruction {
    padding: 1rem 0.75rem;
    margin: 1rem 0;
    border-radius: 12px;
    border-width: 1px;
  }

  .territory-instruction-title {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .territory-instruction-intro {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .territory-step {
    padding: 1rem;
    border-radius: 12px;
  }

  .territory-step-number {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .territory-step-content strong {
    font-size: 1rem;
  }

  .territory-step-content p,
  .territory-step-content li {
    font-size: 0.9rem;
  }

  .territory-instruction-summary {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-left-width: 3px;
  }

  .map-section .map-week-selector {
    gap: 0.35rem;
  }

  .map-section .map-week-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
  }
}

.map-no-data {
  padding: 2rem;
  text-align: center;
  color: #666;
}

.map-week-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.map-week-btn {
  padding: 0.5rem 1rem;
  border: 2px solid rgba(255, 0, 128, 0.4);
  background: #fff;
  color: #333;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.map-week-btn:hover {
  background: rgba(255, 0, 128, 0.08);
  border-color: var(--t2-pink);
}

.map-week-btn.active {
  background: var(--t2-pink);
  border-color: var(--t2-pink);
  color: #fff;
}

.map-and-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.map-grid-wrapper {
  flex: 1;
  min-width: 280px;
  max-width: 640px;
  padding: 1.5rem;
  border-radius: 16px;
  background: url('../img/perm/perm_map_bg.png') center/cover no-repeat, linear-gradient(145deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border: 1px solid rgba(255, 0, 128, 0.15);
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: clamp(4px, 0.5vw, 8px);
  max-width: min(560px, 90%);
  margin: 0 auto;
}

.map-cell {
  aspect-ratio: 1;
  min-height: clamp(36px, 5vmin, 56px);
  border-radius: 8px;
  cursor: default;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.territory-table-wrapper {
  max-width: 480px;
  margin: 0 auto;
}

.territory-table-title {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 0.75rem;
  text-align: center;
}

.territory-count-table {
  max-width: 100%;
}

.territory-count-table .territory-badges {
  text-align: left;
}

.week-badges {
  text-align: left;
}

/* раунд: title, tagline, phrase */
.round-block {
  margin-bottom: 1.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.round-title {
  font-size: 1.25rem;
  color: var(--t2-pink);
  margin-bottom: 0.25rem;
}

.round-tagline {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.round-phrase {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

/* сводка недели */
.week-summary-block {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 0, 128, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(255, 0, 128, 0.15);
}

.week-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.week-summary-title {
  font-size: 1.1rem;
  color: #333;
  margin: 0;
}

.week-summary-badge {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  background: var(--t2-pink);
  color: #fff;
  font-weight: 600;
}

.week-summary-text {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
}

.week-summary-text p {
  margin: 0.25rem 0;
}

/* сводка + фишка в один ряд */
.summary-and-events-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.summary-and-events-row .week-summary-block {
  flex: 1;
  min-width: 260px;
  margin-bottom: 0;
}

.week-events-block {
  flex: 1;
  min-width: 260px;
  padding: 1rem;
  background: rgba(255, 215, 0, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(255, 180, 0, 0.25);
}

.week-events-heading {
  font-size: 1rem;
  color: #333;
  margin: 0 0 0.5rem;
}

.week-events-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--t2-pink);
  margin: 0 0 0.25rem;
}

.week-events-subtitle {
  font-size: 0.9rem;
  color: #555;
  margin: 0 0 0.5rem;
}

.week-events-rules {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #444;
}

.week-events-rules li {
  padding: 0.2rem 0;
  padding-left: 1rem;
  position: relative;
}

.week-events-rules li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--t2-pink);
}

.week-events-sticker {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
  margin: 0;
}

/* трофеи недели */
.week-trophies-block {
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(100, 80, 200, 0.06);
  border-radius: 10px;
  border: 1px solid rgba(100, 80, 200, 0.2);
}

.week-trophies-heading {
  font-size: 1rem;
  color: #333;
  margin: 0 0 0.5rem;
}

.week-trophies-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
  color: #444;
}

.week-trophies-list li {
  padding: 0.2rem 0;
}

.persona-line {
  font-size: 0.8rem;
  color: #fff;
  font-style: italic;
  display: block;
  margin-top: 0.2rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  backdrop-filter: blur(5px);
  font-weight: 500;
}

/* карта + легенда */
.map-legend {
  display: none !important;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 160px;
  flex-shrink: 0;
}

.map-legend-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.map-legend-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-legend-avatar-wrap.use-initials img {
  display: none;
}

.map-legend-initials {
  display: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.map-legend-avatar-wrap.use-initials .map-legend-initials {
  display: flex;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
  transition: all 0.2s;
}

.map-legend-item .map-legend-avatar-wrap {
  order: -1;
}

.map-legend-item:hover {
  border-color: var(--t2-pink);
  background: rgba(255, 0, 128, 0.05);
}

.map-legend-item.map-legend-item-active {
  border-color: var(--t2-pink);
  background: rgba(255, 0, 128, 0.12);
  box-shadow: 0 0 0 2px rgba(255, 0, 128, 0.3);
}

.map-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.map-legend-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.map-legend-delta {
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 0.35rem;
}

.map-legend-delta-up {
  color: #2d6b3a;
}

.map-legend-delta-down {
  color: #a33;
}

/* номера клеток и подсветка */
.map-cell-num {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.6rem;
  color: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.map-cell.map-cell-dimmed {
  opacity: 0.35;
}

.map-cell.map-cell-highlight {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--t2-pink);
  z-index: 1;
}

.map-cell.map-cell-changed {
  animation: mapCellPulse 0.6s ease-out;
}

@keyframes mapCellPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 128, 0.4);
  }

  50% {
    box-shadow: 0 0 8px 2px rgba(255, 0, 128, 0.5);
  }

  100% {
    box-shadow: none;
  }
}

/* ——— Pixi/Voronoi карта: territory-canvas, tooltip ——— */
.territory-canvas {
  width: 100%;
  max-width: 1100px;
  height: 620px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: #0b1220;
}

@media (max-width: 768px) {
  .territory-canvas {
    height: 520px;
  }
}

@media (max-width: 480px) {
  .territory-canvas {
    height: 440px;
  }
}

/* ——— Карта SVG (Conquiztador-style): map-board, territory-map, tooltip ——— */
.map-board {
  flex: 1 1 100%;
  min-width: 280px;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 85% 55% at 50% 25%, rgba(255, 255, 255, .14), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .12) 0%, rgba(248, 245, 238, .1) 25%, rgba(0, 0, 0, .06) 100%);
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .15);
}

.territory-map {
  width: 100%;
  max-width: 1100px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 18px;
}

.territory-province {
  cursor: pointer;
  transition: filter .15s ease;
}

.territory-province:hover {
  filter: brightness(1.12) saturate(1.15);
}

.territory-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: auto;
  transform: translate(12px, 12px);
  padding: 10px 12px;
  padding-right: 40px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font: 600 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  max-width: min(320px, 80vw);
  display: flex;
  align-items: center;
  gap: 10px;
}

.territory-tooltip-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.territory-tooltip-text {
  flex: 1;
}

.territory-tooltip-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 10;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
}

.territory-tooltip-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.territory-tooltip-close:active {
  transform: scale(0.95);
}

.territory-tooltip-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.territory-tooltip-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.territory-tooltip-close:active {
  transform: scale(0.95);
}

/* ——— Полноэкранный режим карты ——— */
.map-fullscreen-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.map-fullscreen-btn:hover {
  background: rgba(17, 24, 39, 0.95);
  transform: scale(1.05);
}

.map-fullscreen-btn svg {
  width: 20px;
  height: 20px;
}

.map-fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  background: #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-fullscreen-overlay[hidden] {
  display: none;
}

.map-fullscreen-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10000;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.map-fullscreen-close:hover {
  background: rgba(17, 24, 39, 0.95);
  transform: scale(1.05);
}

.map-fullscreen-close svg {
  width: 24px;
  height: 24px;
}

.territory-canvas-fullscreen {
  width: 100vw;
  height: 100vh;
  position: relative;
  background: #0b1220;
}

.territory-province.map-cell-dimmed {
  opacity: 0.35;
}

.territory-province.map-cell-highlight .province-fill {
  stroke: var(--t2-pink);
  stroke-width: 8;
}

.territory-province.map-cell-changed {
  animation: mapCellPulsePath 0.6s ease-out;
}

@keyframes mapCellPulsePath {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* лента движухи */
.event-log-block {
  margin-bottom: 1.5rem;
}

.event-log-title {
  font-size: 1.05rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.event-log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
}

.event-log-list li {
  padding: 0.2rem 0;
  border-bottom: 1px solid #eee;
}

.event-log-list li:last-child {
  border-bottom: none;
}

.event-log-empty {
  font-size: 0.9rem;
  color: #888;
  font-style: italic;
  margin: 0;
}

/* мини-бейджи в таблицах */
.mini-badge {
  display: inline-block;
  margin: 0 0.2rem 0.2rem 0;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mini-badge-top1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 193, 7, 0.9));
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(255, 215, 0, 0.5);
}

.mini-badge-holds {
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.9), rgba(102, 187, 106, 0.9));
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(67, 160, 71, 0.5);
}

.mini-badge-zero {
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.9), rgba(239, 83, 80, 0.9));
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(229, 57, 53, 0.5);
}

.mini-badge-up {
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.9), rgba(102, 187, 106, 0.9));
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(67, 160, 71, 0.5);
}

.mini-badge-down {
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.9), rgba(239, 83, 80, 0.9));
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(229, 57, 53, 0.5);
}

@media (max-width: 768px) {
  .update-timer {
    position: static;
    margin: 0 auto 2rem;
    max-width: fit-content;
  }

  .hero-title {
    font-size: 2rem;
  }

  .cta-primary {
    font-size: 2rem;
  }

  .cta-secondary {
    font-size: 1.5rem;
  }

  .prizes-grid {
    grid-template-columns: 1fr;
  }

  .how-cards {
    grid-template-columns: 1fr;
  }

  .ranking-table thead th,
  .ranking-table tbody td {
    padding: 0.8rem 0.5rem;
    font-size: 0.85rem;
  }

  .rules-cards {
    grid-template-columns: 1fr;
  }

  .changes-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .data-update-notification {
    bottom: 10px;
    right: 10px;
    left: 10px;
    font-size: 0.85rem;
  }

  .rules-compact {
    padding: 1rem;
  }

  .rules-cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .rule-card-item {
    padding: 1.5rem;
  }

  .rule-card-icon {
    font-size: 2.5rem;
  }

  .rule-card-title {
    font-size: 1.2rem;
  }

  .rule-result-formula {
    font-size: 1rem;
    flex-direction: column;
  }

  .formula-part {
    margin: 0.25rem 0;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 1rem;
  }

  .section-title {
    font-size: 1.8rem;
  }
}
