:root {
  --main-color: #2c3e50;
  --low-rating: #e74c3c;
  --medium-rating: #f39c12;
  --high-rating: #2ecc71;
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --base-size: min(90vw, 600px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #333;
  padding: 20px;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 1200px;
}

.header {
  text-align: center;
  margin-bottom: 30px;
}

.header h1 {
  color: var(--main-color);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.scale-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
  gap: 5px;
}

.scale-value {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--main-color);
}

.scale-hint {
  font-size: 0.8rem;
  color: #7f8c8d;
  opacity: 0.8;
}

.rating-legend {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.rating-legend div {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rating-legend span {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-high { background: var(--high-rating); }
.legend-medium { background: var(--medium-rating); }
.legend-low { background: var(--low-rating); }

.radial-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 auto;
  transition: transform 0.3s;
  transform-origin: center center;
}

.radial-circle {
  position: relative;
  width: var(--base-size);
  height: var(--base-size);
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow);
  overflow: hidden;
  user-select: none;
}

.scale-lines {
  position: absolute;
  width: 100%;
  height: 100%;
}

.scale-line {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: left center;
  height: 1px;
  background: rgba(0, 0, 0, 0.05);
  width: 50%;
}

.scale-circles {
  position: absolute;
  width: 100%;
  height: 100%;
}

.scale-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.center-point {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--high-rating);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
  z-index: 1;
}

.avatar {
  position: absolute;
  width: calc(var(--base-size) * 0.08);
  height: calc(var(--base-size) * 0.08);
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  transform: translate(-50%, -50%);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: var(--shadow);
  transition: var(--transition);
  z-index: 2;
}

.avatar:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  z-index: 3;
}

.nickname {
  display: none;
  position: absolute;
  bottom: calc(var(--base-size) * -0.05);
  left: 50%;
  transform: translateX(-50%);
  background: var(--main-color);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: calc(var(--base-size) * 0.025);
  min-font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow);
  z-index: 4;
}

.avatar:hover .nickname {
  display: block;
  animation: fadeInUp 0.3s both;
}

/* Модальное окно */
.profile-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s;
}

.modal-content {
  background: white;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  width: 90%;
  max-width: 320px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.4s;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #7f8c8d;
  transition: color 0.2s;
  background: none;
  border: none;
}

.close-btn:hover {
  color: var(--low-rating);
}

.modal-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin: 0 auto 15px;
  border: 4px solid #f1f1f1;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.modal-content h2 {
  margin: 0 0 5px;
  color: var(--main-color);
  font-size: 1.4rem;
}

.department {
  color: #7f8c8d;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.rating-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.rating-bar {
  width: 120px;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.rating-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s;
}

.rating-display span {
  font-weight: 600;
  min-width: 30px;
}

.profile-btn {
  background: var(--main-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile-btn:hover {
  background: #1a252f;
  transform: translateY(-2px);
}

/* Анимации */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
  .scale-hint {
    font-size: 0.7rem;
  }
  
  .rating-legend {
    gap: 10px;
    font-size: 0.8rem;
  }
  
  .modal-content {
    padding: 20px;
  }
  
  .modal-avatar {
    width: 80px;
    height: 80px;
  }
}